There are many times in my code that I need to call ViewXY.FitView() however this will place some data right on the edge of the chart. We are in a situation where they need to be able to select portions of the data which becomes very hard when that data might be right on the edge of the chart. Is there a solution to have it leave some space on the side when fitview is being applied?
Regards,
Aaron
Margins when calling fit view
Moderator: Queue Moderators
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Margins when calling fit view
Y axes have Fit methods, where you can set margin in axis values or in pixels. For X axis there's no such, nor for ViewXY.FitView.
To implement custom fit logic, you may want to get the minimum and maximum of X and Y from the series data. Then add some margin in those. Finally call xAxis.SetRange and yAxis.SetRange with these values.
To implement custom fit logic, you may want to get the minimum and maximum of X and Y from the series data. Then add some margin in those. Finally call xAxis.SetRange and yAxis.SetRange with these values.
LightningChart Support Team, PT