Nevron Forum

Points drag in wireframe surface

https://www.nevron.com/Forum/Topic3613.aspx

By Alex Vorobey - Monday, May 31, 2010

Please help me to find answer:
1. Is it possible to interactively drag points in the wireframe grid surface like it possible in the 2D chart ("Interactivity\Tools\Data Point Drag Tools" C# example) ?
2. How to use NDataPointDragTool to detect which marker from the which series are moved and new position of it? The help and example doesn't describe this.

I'm use trial Nevron .NET Vision 2010.1 for VS2005
By Milen - Wednesday, June 2, 2010

Hi Alex,

Regarding your questions:

1. Currently the surface charts do not support data point dragging.

2. You can subscribe for the EndDrag event of the NDataPointDragTool class and in the event handler you can check the nChartControl1.Controller.Selection.SelectedObjects collection to find out which object has just been dragged.

Best Regards,
Milen

By Alex Vorobey - Thursday, June 3, 2010

Thanks for response, Milen!

The result code is:

void EndDragEventHandler(object sender, System.EventArgs e)
{
  if (nChartControl1.Controller.Selection.SelectedObjects.Count == 1)
  {
    NDataPoint point = (NDataPoint)nChartControl1.Controller.Selection.SelectedObjects[0];
    Debug.WriteLine(String.Format("X:{0} Y:{1}", point[DataPointValue.X], point[DataPointValue.Y]));
  }
}
By Alex Vorobey - Thursday, August 19, 2010

One more question:

In the EndDrag event of the NDataPointDragTool class I got previous coordinates of the marker - that was before drag. Is it possible to get current marker coordinates and change it if requires, for example determine that the value did not exceed the maximum?
By Nevron Support - Friday, August 20, 2010

Hi Alex,

The values are already updated in the series when the EndDrag event is fired, but the data point object keeps the old values. You can read the new ones directly from the series or compose a data point object like this:


NSeries series = (NSeries)point.ParentNode;
NDataPoint newDP = series.ComposeDataPoint(point.IndexInSeries);
MessageBox.Show(String.Format("X:{0} Y:{1}", newDP[DataPointValue.X], newDP[DataPointValue.Y]));

By Alex Vorobey - Wednesday, August 25, 2010

Thanks, works perfect