T O P I C R E V I E W |
BarryRobertson |
Posted - 19 Nov 2012 : 14:44:29 I am looking at DataCursorsAndMarkers as an example. What I need is a control (for touch screen) that a user can drag left/right across the bottom of the graph, moving a vertical marker (and of course I need to get the values of my plots that intersect the marker).
What I was immediately trying to figure out was how to get the screen positions for the left and right side of the plot area so that I can position my control (think of it as a track-bar with a pointer pointing up). The position needs to be about 47 pixels left of the plot and then over 47 to the right of the plot (since it's 95 pixels wide) (see example below if it displays well).
I have my trackbar minimum and maximum set corresponding to the plot area's time axis that is visible. I currently do not have this control inside my graph object (it's external, but directly beneath).
I haven't found the right thing to get "real" coordinates on the screen of the left/right of the plot. It seemed like I could query something to get the position/bounding box of the x-axis, but I didn't get data that made sense.
My slider control looks similar to this (dots for spacing here).
_____/\_____ |............|________________________________________________ |____________|
The pointer part (pointing up) needs to align with the left of my plot when all the way left, and align with the right of the plot area when all the way to the right.
If I'm doing this completely wrong, creating an issue where there shouldn't be one, that would be nice to know.
Thanks for your help. |
1 L A T E S T R E P L I E S (Newest First) |
quinncurtis |
Posted - 19 Nov 2012 : 23:20:34 The pixel boundaries of the plotting area, normally the area bounded by the axes, can be retrieved using the coordinate systems GetPlotRect()method.
Rectangle2D plotrect = pTransform1.getPlotRect();
|
|
|