Removing a Plotted Point From a Chart
John K.
Bacau,

Jul 14, 2011
55 Posts

Removing a plotted point from a chart

Hello! I have to plot multiple points on a chart with multiple colors. When some keyboard event occurs, a so called current point has to change it's colour from green to red, so I've plotted a point with the red colour over the one plotted with green. But I have to implement the undo options also! So... I'm trying now to implement the backspace key, so the current point changes it's colour from red to green, but this thing isn't happening! It's because my green point is there but it is under the red one! How can I cancel the red one, so my green point will become visible again? I can't use ClearData because I have other red points that have to be visible.... This is a though one :(

Solution Available
Victor B.
Lake Forest, CA

Jul 18, 2011
91 Posts

Re: Removing a plotted point from a chart

Interesting problem, Alex.  I came up with a quick solution, but you may have to adapt it a bit to make it fit your situation.  You will need to create two overlapping plots on your chart.  The red plot will contain all of the data and the green plot will only contain one point, which is the current/active point.  I have attached the example to this post.

Summary:
-Create two plots on your chart, make the red plot first on the chart list and the green plot second.  This will make sure that green overlaps red.
-Save all the data for the red plot into an array (I used program variable 'adData')
-In the forms OnLoad event, initialize a current point variable to 0 (Form variable 'lCurrentX').  This variable will be used to keep track of the green point.
-In the form's OnKeyDown event, update the current point variable (In the example, F2 goes forward, F1 goes back)
-Each time the current point is updated, update the Green Plot using the red plot array and the current point variables.  Make sure you clear data so you erase the previous green point.

Regards,
Victor Brode


File Attachment:
GreenPlotUpdate.rar



Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]