harmonising right and left axis grid increments

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
toreba
Newbie
Newbie
Posts: 17
Joined: Thu Aug 07, 2014 12:00 am

harmonising right and left axis grid increments

Post by toreba » Thu Jul 09, 2015 5:02 pm

Hi,

When showing both right and left axes, the TChart does not attempt to harmonise grid lines such that they fit both left and right axes. In order to do this programmatically, I need to calculate the number of left axis increments and use this to optimize the right axis maximum and minimum.

But the axis maximum property returns the maximum of its dependent series rather than the maximum value that the axis accommodates. How can I get at the maximum accommodated axis value?

Thanks for any advice.

Regards

Toreba

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

Re: harmonising right and left axis grid increments

Post by Yeray » Fri Jul 10, 2015 8:09 am

Hi Toreba,

This sounds pretty similar to what was discussed here, isn't it?

If you still find problems with it, please try to arrange a simple example project we can run as-is to reproduce the problem here.
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

toreba
Newbie
Newbie
Posts: 17
Joined: Thu Aug 07, 2014 12:00 am

Re: harmonising right and left axis grid increments

Post by toreba » Fri Jul 10, 2015 9:44 am

Yeray,

It's not clear that the code example given there is going to help. It seems to use some mysterious integer constants, and methods such as CalcPosValue are not described in the help file, which simply says 'internally used to speed up axis calculations'.

I have one series on the left axis and another on the right axis, and so scales are completely different for the two series, but for neat display I want to calculate right axis extents and increment so that the grid lines associated with each axis align. To simplify what I am asking, is there a method which returns the chart value at each end of the axis, i.e. the axis maximum and minimum, not the maximum and minimum values of dependent series?

Regards

Toreba

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

Re: harmonising right and left axis grid increments

Post by Yeray » Fri Jul 10, 2015 1:36 pm

Hello Toreba,
toreba wrote:To simplify what I am asking, is there a method which returns the chart value at each end of the axis, i.e. the axis maximum and minimum, not the maximum and minimum values of dependent series?
Note the axes minimum and maximum are calculated during the drawing process. So you may need to force a chart repaint (Chart1.Draw) before accessing them.
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

toreba
Newbie
Newbie
Posts: 17
Joined: Thu Aug 07, 2014 12:00 am

Re: harmonising right and left axis grid increments

Post by toreba » Mon Jul 13, 2015 11:13 am

Ah yes! Thank you!

Post Reply