Scroll Axis of zoomed chart


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

By shweta jain - 4 Years Ago
Hello,
I want to scroll both primary x and primary y axis of chart after zoom.
How can I add this axis scrolling after zoom in the chart?
I have tried by adding NDataPanTool in the chart by taking reference of example of DataPanTool. but it does not work.
- chartControl.Controller.Tools.Add(new NDataPanTool()).
Is it affected by cursor type? I am also using NAxisCursor in the same chart.

Can you Please provide me code for "Axis scrolling in the chart"
By Nevron Support - 4 Years Ago

Hi Shweta,

The following code shows how to configure thechart for zooming and scrolling:

NCartesianChart chart =(NCartesianChart)nChartControl1.Charts[0];
chart.Axis(StandardAxis.PrimaryX).ScrollBar.Visible= true;
chart.Axis(StandardAxis.PrimaryY).ScrollBar.Visible= true;
chart.RangeSelections.Add(new NRangeSelection());

NPointSeries point = new NPointSeries();
point.Values.Add(10);
point.Values.Add(20);
point.Values.Add(30);
chart.Series.Add(point);

nChartControl1.Controller.Tools.Add(newNPanelSelectorTool());
nChartControl1.Controller.Tools.Add(newNAxisScrollTool());
nChartControl1.Controller.Tools.Add(newNDataZoomTool());
nChartControl1.Controller.Tools.Add(newNDataPanTool());

You can also take a look at the examples in the Interactivity / Tools section onhow to configure all the features in each tool individually.