Limit zoom level


https://www.nevron.com/Forum/Topic11884.aspx
Print Topic | Close Window

By Irina - 8 Years Ago
Hi,
Is it possible to limit the zoom level of the chart to prevent users from zooming in endlessly?
Thank you
By Nevron Support - 8 Years Ago
Hi Irina,
Yes you need to set the min / max page sizes:

   NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];

   NRangeSelection rangeSelection = new NRangeSelection();

   rangeSelection.MinHorizontalPageSize = 1;
   rangeSelection.MinVerticalPageSize = 1;

   chart.RangeSelections.Add(rangeSelection);

   NBarSeries bar = new NBarSeries();
   bar.Values.Add(10);
   bar.Values.Add(20);
   bar.Values.Add(30);
   chart.Series.Add(bar);

   nChartControl1.Controller.Tools.Add(new NPanelSelectorTool());
   nChartControl1.Controller.Tools.Add(new NDataZoomTool());

Let us know if you meet any problems.