08-31-2012 06:32 PM
This seems like it should be really easy, but then again I've been at work for the past 13 hours, so maybe I'm just being dumb.
I have an XY graph. I wanted to put some decorations over it to indicate a certain area.
I clicked on all the lines, then selected "Move to Front"
I then clicked the graph and clicked "Move to Back".
When it's not running it looks correct:
\
As soon as I start running the VI, the decorations drop behind the graph.
Am I missing something obvious?
Solved! Go to Solution.
08-31-2012 07:04 PM
If your decorations are completely contained within the graph area, can I suggest an alternate approach? The XY Graph has a set of "Plot Images" properties. You can write to them to draw on the graph, using the picture functions. So, for example, if you just want to draw a rectangle on a portion of the graph, you can do so using "Draw Rect" with the picture output wired to the plot image.
08-31-2012 07:15 PM
@nathand wrote:
If your decorations are completely contained within the graph area, can I suggest an alternate approach? The XY Graph has a set of "Plot Images" properties. You can write to them to draw on the graph, using the picture functions. So, for example, if you just want to draw a rectangle on a portion of the graph, you can do so using "Draw Rect" with the picture output wired to the plot image.
The Draw Rect function takes inputs of Left, Top, Right, Bottom.
Are those coordinates in the XY graph or coordinates on the entire front panel?
08-31-2012 07:24 PM
@cory K wrote:
The Draw Rect function takes inputs of Left, Top, Right, Bottom.
Are those coordinates in the XY graph or coordinates on the entire front panel?
They're relative to the graph area (0,0 is the upper left of the graph).
As you may know, the graph has a method called "Map XY to Coords" which gives you coordinates relative to the panel origin. You can convert this to coordinates within the graph for use with the drawing functions by subtracting the "left" and "top" coordinates of the graph's Plot Bounds. I find it convenient to bundle these two properties into a cluster and then subtract the cluster from the output of Map XY to Coords. This is useful for drawing images within the graph's coordinate system.
08-31-2012 07:42 PM
Awesome, thanks. Worked perfectly.