Page 1 of 1

TChart and customized X Axis

Posted: Wed Dec 02, 2015 3:18 pm
by 16571424
Hi,

i'm using a chart with 2 series stacked (TBarSeries).

The bottom axis contains values from 0 to 200 but with some time a gap inside.
So my question is: how can i set the bottom axis to display only values having data ?

Example: i have the following set of values: 0,10,40,50,60,70,80,90,100,110,120,130,140,150,160,170 (corresponding to my bottom axis) by increment of 10.
So i wish to remove the gap between 10 and 40 (excluded), i mean the label 40 must follow the label 10, without living any space for 20 and 30.
How can i do this?

BR

Laurent

Re: TChart and customized X Axis

Posted: Wed Dec 02, 2015 4:19 pm
by yeray
Hello Laurent,

I can think on at least two options to achieve that:

1. You can add your values in the bar series without XValue, but passing the DateTime as Label. This way the values will be added in sequential XValues and the bottom axis will show the label each bar has.

2. You can use a TAxisBreaksTool to add a break from 10 to 40. See an example at "All features\Welcome !\Tools\Axis Breaks" in the Features Demo project shipped with the binary installation.

Re: TChart and customized X Axis

Posted: Wed Dec 02, 2015 5:19 pm
by 16571424
Tnx Yeray,

i do not have date values (????).
Y axis is a quantity (numerical)
X axis is a numerical internal code.

About the second option, is it part of the 2014 version?
I did not install the 2015 yet.

Tia

Laurent

Re: TChart and customized X Axis

Posted: Wed Dec 02, 2015 5:46 pm
by yeray
Hello Laurent,
Laurent wrote:i do not have date values (????).
Y axis is a quantity (numerical)
X axis is a numerical internal code.
I'm sorry. But the same applies. The trick is to transform the XValues to strings and add the points with YValue and Label only.
Laurent wrote:About the second option, is it part of the 2014 version?
I did not install the 2015 yet.
Yes, it's included since v2010.

Re: TChart and customized X Axis

Posted: Wed Dec 02, 2015 6:04 pm
by 16571424
Great!

Thanks a lot Yeray.

Have a nice day.

Laurent