Ano Ano Posted October 7, 2011 Report Share Posted October 7, 2011 Hello, Assuming that there is a waveform graph with many plots. If there are too many plots then there will be havoc on screen. Is there any way to point/click with the mouse or use the cursor and have a label that shows the name of the plot in question? Thank you in advance Quote Link to comment
mje Posted October 7, 2011 Report Share Posted October 7, 2011 I've done this a few ways. The easiest way is to use a graph's built in cursors to display the information when you pin the cursors to a plot (right click a graph, visible items: cursor legend). Adding a layer of complexity, if the built in display isn't appropriate for your UI, you could still use the cursors but keep the UI hidden, and use the mouse move events to extract the appropriate information via property nodes and display it in your own indicators. Even more complex, you can roll your own so to speak: Have a tooltip VI running in the background which can receive data from the VI that has the graph. Use a mouse move event to calculate the nearest point to the cursor. The graph has a method to transform screen coordinates to the coordinate space of the graph (or vice versa) to help with this. Pass whatever information you need to your tooltip VI. The tooltip VI receives the data and shows itself at the proper location, usually as a floating window. When the mouse leaves the graph, don't forget to notify the tooltip VI so it knows to hide itself. Doing it this way means your tooltip can literally be anything, as the appearance is defined entirely by another VI. Here's an example of a tooltip that appears in an application of mine when you hover over a data point: Quote Link to comment
viSci Posted October 7, 2011 Report Share Posted October 7, 2011 Yes, you can use the GetPlotAtPos Method and use the Mouse Move event (and use the Coords event data) for the pane that contains the graph and you will get a Plot Number output for the plot trace that is closest to the mouse cursor. Quote Link to comment
Ravi Beniwal Posted October 10, 2011 Report Share Posted October 10, 2011 Another display option could be visually changing the appearance of the plot to "highlight" it to show that it was "clicked" or "selected" and then scroll the plot legend to show which plot that was. Conversely, you can click on a plot name in the legend and it can "highlight" the corresponding plot in the graph. I've wrapped all this up in XControls; works great. In the screenshot below, the red plot was clicked. The legend scrolled to bring the corresponding plot on the top and also highlighted the plot name (in blue). Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.