Refresh

This website forums.ni.com/t5/LabVIEW/Draw-a-Shape-on-Graph/m-p/1472064 is currently offline. Cloudflare's Always Online™ shows a snapshot of this web page from the Internet Archive's Wayback Machine. To check for the live version, click Refresh.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Draw a Shape on Graph

Hi

 

I am trying to draw a shape which is very much like a  trapeziod on a graph.  This shape comes from specifications and I am trying to show that the data lie within the bound formed by this shape.  I can easily draw rectangle or square using the cursors, but drawing a triangle does not look straightforward to me. I can always plot any shape programmatically, which will appear on the graph while the VI runs.  But, I want this shape to be there all the time, just like cursors.  Can someone help?

 

Thanks

0 Kudos
Message 1 of 6
(6,998 Views)

Use the "plot images" property. It allows you to display anything (that you could also draw on an image indicator) on your graph. 

 

(Here's an old example that draws circles, also look at the examples quoted on the help page)

 

You could use three (triangle) or four (trapezoid) moveable cursor dots and redraw the shape when their position changes.

Message 2 of 6
(6,995 Views)

Thanks.   I like to know more about your last method.  I created 3 moveable cursor points, but how do I redraw the lines when their position changes?

 

Thanks

0 Kudos
Message 3 of 6
(6,979 Views)

Here is a similar example.  You can click to create cursors and drag them around.

 

http://forums.ni.com/t5/LabVIEW/How-to-select-a-set-of-points-in-a-xy-graph-contained-in-an-area/m-p...

 

Message 4 of 6
(6,968 Views)

Thanks.  It is cool, but I am looking for something simple using the cursors.

0 Kudos
Message 5 of 6
(6,961 Views)

The can simplify Darin's code.

 

Remove all the logic to determine interior/exterior and reduce it to drawing the polygon when any of the cursors is moved. There won't be much code left. 😉

Message 6 of 6
(6,954 Views)