Page 1 of 1

Margins when calling fit view

Posted: Fri Aug 30, 2013 8:38 pm
by symbolick
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

Re: Margins when calling fit view

Posted: Sun Sep 01, 2013 4:41 pm
by ArctionPasi
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.