Dear Steema Support,
I'd like to have the max/min range of vertical axis fit only for "visible points" whenever I change the bottom axis' min/max value programmatically. How can I do that? Currently the automatic property of an axis is taking all points in a series into account, not just visible ones. Thanks.
How to make vertical axis fit only for visible points?
Re: How to make vertical axis fit only for visible points?
Hi,
You have to loop into the visible points (from FirstDisplayedIndex to LastDisplayedIndex) looking for the minimum and maximum YValue in the range and call the left axis SetMinMax function with these values.
You have to loop into the visible points (from FirstDisplayedIndex to LastDisplayedIndex) looking for the minimum and maximum YValue in the range and call the left axis SetMinMax function with these values.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: How to make vertical axis fit only for visible points?
Is there a way to know whether the bottom axis boundary(visible area) is changed, or one of the visible Y values is changed so that I can recaculate the vertical axis' visible min/max, just like what TChartAxis.Automatic does? I can catch the TChartSeries.OnAfterAdd, OnClearValues events but there is no "on data change" event.
Re: How to make vertical axis fit only for visible points?
Hi,
I'm afraid there is no "on data change" event but you probably know when the data can be changed, isn't it? I mean, you probably have a routine that does it or a button to show the values in an editable grid,... so you should be able to adjust the axes after this routine/button is executed.
If it's a routine/function who changes the values, and if this routine is executed very frequently, looping through all the visible values to check if the axes need to be adjusted may be inefficient. But in this case, you probably have control to the routine and you know when exactly a value is changed and so when the axis adjustment should be done.
I'm afraid there is no "on data change" event but you probably know when the data can be changed, isn't it? I mean, you probably have a routine that does it or a button to show the values in an editable grid,... so you should be able to adjust the axes after this routine/button is executed.
If it's a routine/function who changes the values, and if this routine is executed very frequently, looping through all the visible values to check if the axes need to be adjusted may be inefficient. But in this case, you probably have control to the routine and you know when exactly a value is changed and so when the axis adjustment should be done.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |