TChart and customized X Axis

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Laurent
Newbie
Newbie
Posts: 3
Joined: Mon Feb 02, 2015 12:00 am

TChart and customized X Axis

Post by Laurent » Wed Dec 02, 2015 3:18 pm

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

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TChart and customized X Axis

Post by Yeray » Wed Dec 02, 2015 4:19 pm

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Laurent
Newbie
Newbie
Posts: 3
Joined: Mon Feb 02, 2015 12:00 am

Re: TChart and customized X Axis

Post by Laurent » Wed Dec 02, 2015 5:19 pm

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

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TChart and customized X Axis

Post by Yeray » Wed Dec 02, 2015 5:46 pm

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Laurent
Newbie
Newbie
Posts: 3
Joined: Mon Feb 02, 2015 12:00 am

Re: TChart and customized X Axis

Post by Laurent » Wed Dec 02, 2015 6:04 pm

Great!

Thanks a lot Yeray.

Have a nice day.

Laurent

Post Reply