I wrote my own routine to scale the axes of a series, so I also have margins for the X axis. Works fine:
Thanks,
Joost
Now I need the show the same series with an aspect ratio of 1. The calculated axes ranges are the same as for the picture above, but now the series is shown like this:
As you see, the series is cut off because the aspect ratio adjusts the X axis to match the Y axis. Instead I would have expected the range to be increased to show the entire series, like this:
Is there a setting I must adjust to get the expected behavior? Or might it be a bug?ZoomPanOptions with AspectRatio
Moderator: Queue Moderators
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: ZoomPanOptions with AspectRatio
If graph area (width * aspectratio) < height, Y axis range is set by X range.
If graph area height < (width * aspectratio), X axis range is set by Y range.
It is by design.
If graph area height < (width * aspectratio), X axis range is set by Y range.
It is by design.
LightningChart Support Team, PT
Re: ZoomPanOptions with AspectRatio
The I would like to propose an extension of the design (maybe through an extra setting):
When the min and max of the axes are explicitly set:
- if aspect ratio of axes > aspect ratio of graph, then Y is set by X
- if aspect ratio of axes < aspect ratio of graph, the X is set by Y
(where aspect ratio of axes = (max Y - min Y) / (max X - min X))
When the min and max of the axes are explicitly set:
- if aspect ratio of axes > aspect ratio of graph, then Y is set by X
- if aspect ratio of axes < aspect ratio of graph, the X is set by Y
(where aspect ratio of axes = (max Y - min Y) / (max X - min X))
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: ZoomPanOptions with AspectRatio
We can't do that unfortunately. There's no telling if the axis Minimum and Maximum properties are set by user or by internal zooming logic, panning, touch events, or SetRange method.
Please make your own logic based on event handlers of the chart. For example, hook into chart.SizeChanged, xAxis and yAxis RangeChanged, Zoomed etc. events, and calculate the new axis ranges based on your needs. If you do that, disable aspect ratio in ZoomPanOptions.
Please make your own logic based on event handlers of the chart. For example, hook into chart.SizeChanged, xAxis and yAxis RangeChanged, Zoomed etc. events, and calculate the new axis ranges based on your needs. If you do that, disable aspect ratio in ZoomPanOptions.
LightningChart Support Team, PT
Re: ZoomPanOptions with AspectRatio
You're right, min and max won't do. But what about the RangeRevertMinimum and RangeRevertMaximum, because those are the min and max I set in my custom logic. I also have ZoomPanOptions.RightToLeftZoomAction set to RevertAxisRanges.