Hi!
For some xy graphs, we would like handle scaling in a customized way: The Y minimum should be 0 and the Y maximum should always be rounded up to 10^n, 2*10^n or 5*10^n.
So 0.01, 200 or 5, but not 15 or 3.5 - in this case the axis should go to 20 or 5 respectively.
Now, we can do the computation ourselves, given the max Y value - but is there an easy way to make this be called when AutoFit is used?
Overriding scaling decisions in YAxis Autofit
Moderator: Queue Moderators
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Overriding scaling decisions in YAxis Autofit
Hello.
You can set chart.ViewXY.ZoomPanOptions.RightToLeftZoomAction = RevertAxisRanges.
When applying zoom-to-fit gesture (default action for right-to-left zooming) it will set X and Y axes ranges from
xAxis.RangeRevertMinimum to xAxis.RangeRevertMaximum
and
yAxis.RangeRevertMinimum to yAxis.RangeRevertMaximum
So, store your preferred scaling values in these properties.
If you want to exclude either axis from range revert, set that axis' RangeRevertEnabled = False.
I hope this helps
You can set chart.ViewXY.ZoomPanOptions.RightToLeftZoomAction = RevertAxisRanges.
When applying zoom-to-fit gesture (default action for right-to-left zooming) it will set X and Y axes ranges from
xAxis.RangeRevertMinimum to xAxis.RangeRevertMaximum
and
yAxis.RangeRevertMinimum to yAxis.RangeRevertMaximum
So, store your preferred scaling values in these properties.
If you want to exclude either axis from range revert, set that axis' RangeRevertEnabled = False.
I hope this helps
LightningChart Support Team, PT
Re: Overriding scaling decisions in YAxis Autofit
I'm afraid this is not exactly what i was looking for.
Assume we have s graph that's more or less a straight line from 0,0 to 100,100.
Now, the user zooms in on the xrange to see [5;30]. In this case, I want the YAxis to adjust to [0;50].
When he then zooms further into [8;12], I want the YAxis to adjust to [0;20].
Assume we have s graph that's more or less a straight line from 0,0 to 100,100.
Now, the user zooms in on the xrange to see [5;30]. In this case, I want the YAxis to adjust to [0;50].
When he then zooms further into [8;12], I want the YAxis to adjust to [0;20].
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Overriding scaling decisions in YAxis Autofit
Ok. Please set RangeChanged event handler for the X axis. In the event handler, call yAxis.SetRange with preferred range.
LightningChart Support Team, PT