Hi James,
The following code shows how you can mix the data cursor tool with other tools:
NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];
chart.RangeSelections.Add(new NRangeSelection());
NAxisCursor xAxisCursor = new NAxisCursor();
xAxisCursor.SynchronizeOnMouseAction = MouseAction.Move;
xAxisCursor.BeginEndAxis = (int)StandardAxis.PrimaryY;
chart.Axis(StandardAxis.PrimaryX).Cursors.Add(xAxisCursor);
NAxisCursor yAxisCursor = new NAxisCursor();
yAxisCursor.SynchronizeOnMouseAction = MouseAction.Move;
yAxisCursor.BeginEndAxis = (int)StandardAxis.PrimaryX;
chart.Axis(StandardAxis.PrimaryY).Cursors.Add(yAxisCursor);
chart.Axis(StandardAxis.PrimaryX).ScrollBar.Visible = true;
chart.Axis(StandardAxis.PrimaryY).ScrollBar.Visible = true;
NPointSeries pointSeries = new NPointSeries();
pointSeries.Values.Add(10);
pointSeries.Values.Add(20);
pointSeries.Values.Add(30);
chart.Series.Add(pointSeries);
nChartControl1.Controller.Tools.Add(new NPanelSelectorTool());
nChartControl1.Controller.Tools.Add(new NAxisScrollTool());
nChartControl1.Controller.Tools.Add(new
NDataZoomTool());
nChartControl1.Controller.Tools.Add(new NDataCursorTool());
Note that when a drag tool begins an operation (
NDataZoomTool or NAxisScrollTool) it will capture all events until the operation is complete as it becomes an active tool. Do you want to have data cursors synchronized during a drag operation - for example data zoom?
Best Regards,
Nevron Support Team