Profile Picture

Data point drag tool - how to fire event after using the arrow keys, or turn them off

Posted By Kevin Harrison 9 Years Ago

Data point drag tool - how to fire event after using the arrow keys,...

Author
Message
Kevin Harrison
Question Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865
Hi

I have successfully attached an event to NDataPointDragTool.EndDrag, but this does not fire if I use Ctrl + arrow keys to move the data points. How do I do this? Also, it would be useful to know how to turn off the Ctrl + arrow key movement completely.

By the way, the link to NDataPointDragTool in the installed help file is broken.

Thanks

Kevin

Nevron Support
Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
Hi Kevin,
You can use the DragLeftShortcut, DragRightShortcut, DragUpShortcut and DragDownShortcut properties to disable moving the data point in particular direction - for example:
dataPointDragTool.DragLeftShortcut = new NShortcut();
Unfortunately there is no data point moved event (we'll add one) but for the time being you can inherit from the NDataPointDragTool and override the OnKeyDown method:

 class MyDataPointDragTool : NDataPointDragTool
 {
  public override void OnKeyDown(object sender, NKeyEventArgs e)
  {
   base.OnKeyDown(sender, e);

   if (e.Handled)
   {
    // the data point was moved
   }
  }
 }

Hope this helps - let us know if you meet any problems or have any questions.


Best Regards,
Nevron Support Team



Kevin Harrison
Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865
Thanks - that works a charm.

Is there a way for me to enable selection of multiple datapoints for dragging, while still having zoom functionality on the same chart?

Thanks

Kevin

PS All the NTool links I have tried in the installed help file are broken! Mr Google has come to my aid though.

Nevron Support
Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
Hi Kevin,
You can intercept the Drag event fired by the tool and move the other data points programmatically by changing their values, You should also intercept the Cancel event and revert the chart to its original state (will be called when the user presses Esc). We'll also check the mentioned links in the documentation - most likely this occurred when we changed the namespace of those tools.

Best Regards,
Nevron Support Team



Kevin Harrison
Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865
Hi

I have another question about the drag tool. My users would like some form of snapping feature so they can drag accurately to a specific value. Is there anything within the drag tool that enables me to achieve this?

I could determine the dragged to value, calculate the "snapped" value, then redraw the chart, but I was wondering if there is already something to help me?

Thanks
Kevin

Nevron Support
Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
Hi Kevin,
There is no way to perform snapping with the current implementation - however we can send you the tool implementation so that you can develop your own version which supports snapping. If you're interested just drop us an e-mail at support@nevron.com and we'll send you the source code of the stock tool.

Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic