10-26-2010 10:04 AM
I would like to use an XY graph to plot data. Then when the user clicks on one of the data points be able to bring data up about the point using the mouse up event. Has anyone ever tried this?
John
10-26-2010 11:53 AM
Not exactly the same be here is what I did to place a cursor at the mouse click position (xvalue) in an xy graph.
I first compare the mouse click coordinates with the graph plot bound area the validate that the mouse click is in the plot area of the graph (the false case is empty). The substractions and division are used to convert the mouse click coordinates into graph plot coordinates. Once you have this you can convert these plot coordinates into xy coordinates using proportions and the x and y scales max and min values. When you have the mouse click xy value you just have to measure the distance between this point and all data points to find the closest one.
Hope this help.
Ben64
10-26-2010 11:57 AM - edited 10-26-2010 12:01 PM
10-26-2010 12:05 PM
Alot less code to use the plot method map coordinates to XY and then find closedt point, this is a very nice method and saved all the math that had to be done in the past. You could also lock a cursor to the graph and move the cursor.
10-26-2010 12:09 PM
As for the data up about the point, cursor locked to the graph is nice you can change the text of the cursor on mouse move and change the cursor name, format the point info to a string. There are many other ways to do this.
10-26-2010 12:15 PM
@falkpl wrote:
As for the data up about the point, cursor locked to the graph is nice you can change the text of the cursor on mouse move and change the cursor name, format the point info to a string. There are many other ways to do this.
After those two posts, I am speachless.
Not because I am shocked but that was I would have said.
Ben