From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-29-2016 05:31 PM
I would like to use the mouse up (Mods:Double click) to detect which plot area of a stacked waveform chart was clicked. There doesn't seem to be a property which effectively says "Clicked within plot area n". Just properties which identify coordinates relative to some reference which I can't seem to find within the labView help (For stacked plots).
Is there a property or a common method for calculating the plot area selected?
Thanks,
XL600
Solved! Go to Solution.
01-29-2016 10:18 PM
If I understood well, this could help you.
01-30-2016 07:41 AM
That is how the charts are populated, yes. But if I click on one of the stacked plot axes and capture the mouse up event, how would I detect which axis was clicked and where in that specific axis the click occurred?
01-30-2016 08:23 AM
AYanez a écrit :If I understood well, this could help you.
It is more complicated than that. The plot area bounds gives the bounds value for the active plot. For stacked plots the default is plot 0. So this gives you the bounds for the first plot area. You need to get the number of plots and activate them to get the bounds values for each plot area. Then when the mouse is clicked you have to find if it the coordinates are included in one of the plot area.
Here how to do it. I leave it to the OP to modify it for mouse up double click event.
Ben64
01-30-2016 09:04 AM
Ahh, so the mouse click coords are relative to the same origin as the plot bound rectangle verticies? I don't have my LV system available at the moment so I can't check. But the technique you use us exactly what I need! I can't wait to give it a try on Monday.
thanks!
01-30-2016 09:32 AM
xl600 a écrit :Ahh, so the mouse click coords are relative to the same origin as the plot bound rectangle verticies? I don't have my LV system available at the moment so I can't check. But the technique you use us exactly what I need! I can't wait to give it a try on Monday.
thanks!
Yes, they are both absolute coordinates using the FP origin.
Ben64
02-01-2016 09:54 AM
It works like a charm. I did tweak the idea a bit thouugh. I have many signals in each of the stacked plots and wanted to avoid reading the value data array (I'm also using dynamic signals) just to determine the number of plots. When I used your approach, I would get a number of plots matching my signal count, and not the number of plots themselves. I realized that it isn't an error to set the ActPlot to a higher value so I created a subVI to get the boundaries in a rapid fashion so I can just calculate the boundaries on the mouse click event. My selected chart changes so I also didn't want to store the boundaries. Why NI doesn't provide a property for NumPlots is a mystery. Seems obvious that users would want to iterate through plots.
02-01-2016 10:18 AM
02-01-2016 10:32 AM
And right back at you!
Thanks again!