08-25-2006 10:02 AM
08-28-2006 09:07 AM
08-28-2006 11:53 AM
08-28-2006 02:30 PM
08-28-2006 02:37 PM
08-28-2006 08:38 PM
08-29-2006 10:01 AM
04-11-2007 09:16 AM
Hi,
I have a similar problem using the CWGraph in visual basic 6.
I'd like to snap minmaxregions to my plot. I would like the annotation to react just like a cursor. That would mean if I set the region.xcoordinates at some values they would automatically snap to the nearest plot's values.
I cannot seem to get this to work, since if I set the annotation snap mode to "pointonanyplot" or such, the region starts to neglect the shape's xcoordinates and starts using the point index as a reference.
This is also explained in the help:
If you set SnapMode to cwCSnapFloating, the shape is drawn at the values specified by CWShape.XCoordinates and CWShape.YCoordinates, and you can move the entire annotation anywhere in the graph area. If you set SnapMode to cwCSnapPointsOnPlot, the shape is centered around the plot point defined by the Plot and PointIndex properties, and you can move the shape along the plot.
Now I don't want it to center, yet I'd like to give the starting and endposition of the region and make sure it snaps too (thus I can not use cwSnapFloating). Is there a way to achieve this?
Thanks
04-12-2007 04:17 PM
04-13-2007 02:41 AM - edited 04-13-2007 02:41 AM
I've seen the example before, yet I'm affraid it's not a solution for my problem.
I'll try to be more specific.
I don't have (nor specifically want) any cursors, I have a cwGraph with a plot. Now I want to highlight a part of the plot by draging the mouse horizontally on the plot. The "selection" has to snap (dynamically) to the values on the plot.
I handle this by updating a minmax region-annotation shape's xcoordinates.
This xcoordinates property of the shape have to snap to the plot-values.
I use the plot's mousedown and mousemove events to determin the initial start/end positions (Xpos) of the mouse, and I pass these values to the annotation's xcoordinates property, thus updating the highlight on the fly.
Now if the shape is "floating" the shape draws fine, yet it's not snapping to the values. If I make the shape snapping to pointsonanyplot however the shape starts acting in this "pointindex mode" (as I refer to it for now) as I wrote before, which is an unwantend different behaviour.
Is there a way to make the shape snap both it's xcoordinates to the plot instead of switching to this "pointindex-mode"?
Thanks
Message Edited by Michanovich on 04-13-2007 02:43 AM
Message Edited by Michanovich on 04-13-2007 02:43 AM