03-20-2006 03:14 PM
03-20-2006 09:09 PM
The graphs have a GetPlotAt method that will return a reference to the plot if there is a plot point at the specified coordinates. You could use this method in a mouse event handler, check to see if there is a plot at the specified coordinates, and if so, associate the plot with the cursor. For example:
private void OnPlotAreaMouseDown(object sender, MouseEventArgs e) { XYPlot plot = graph.GetPlotAt(e.X, e.Y); if (plot != null) xyCursor1.Plot = plot; }
- Elton
03-21-2006 10:21 AM
Thanks Elton. That will work fine. I was hoping there was a "get nearest plot" type of thing. But we will just have to make the user click on the plot.
Thanks again,
Scott
03-21-2006 10:29 AM
Another thing you could consider doing is adding a legend for the plots and then let users associate the cursor with the plots via the legend items, via clicking on the legend item for the plot, a context menu on the legend, etc.
- Elton
03-21-2006 10:50 AM
Yes. That was in fact one of the ways I had suggested. They want the "click on plot" method also, however, because that is what their previous Motif program gave them. I will also give them the up down arrow keys to cycle through plots.
Scott