Hi Randy,
"Also when I click the chart plot area it shows a vertical line where I clicked, I don't see where that's coming from."
That's most likely the cursor position being updated (though in that case you should get the value changed event). You also need an active chart in order for the data cursor tool to work properly. The following code snippet shows how to achieve that:
private void Form1_Load(object sender, EventArgs e)
{
NChart chart = nChartControl1.Charts[0];
NPointSeries point = new NPointSeries();
for (int i = 0; i < 10; i++)
{
point.Values.Add(i);
}
chart.Series.Add(point);
NAxisCursor axisCursor = new NAxisCursor();
axisCursor.BeginEndAxis = (int)StandardAxis.PrimaryY;
axisCursor.ValueChanged += new EventHandler(OnValueChanged);
axisCursor.SynchronizeOnMouseAction = MouseAction.Down;
chart.Axis(StandardAxis.PrimaryX).Cursors.Add(axisCursor);
nChartControl1.Controller.Tools.Clear();
nChartControl1.Controller.Selection.SelectedObjects.Add(chart);
nChartControl1.Controller.Tools.Add(new NDataCursorTool());
}
void OnValueChanged(object sender, EventArgs e)
{
}
Notice that in the above code the active chart is specfied explicitly using:
nChartControl1.Controller.Selection.SelectedObjects.Add(chart);
You can also use a selector tool to have a dynamically changing active chart (in case you have multiple charts) in which case the code that configures the controller should look like:
nChartControl1.Controller.Tools.Clear();
nChartControl1.Controller.Tools.Add(new NSelectorTool());
nChartControl1.Controller.Tools.Add(new NDataCursorTool());
Hope this helps - let us know if you meet any problems.
Best Regards,
Nevron Support Team