LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fill rectangle with a specified color

hello guys,
  i am plotting a rectangle, which represents the amount of force applied on force transducer.  It moves left or right depending on whether the force is applied or not.  using the force value at any particular time, i have written a code for generating a rectangle on XY graph.  How can i fill this rectangle with any color?  Thank you.
 
Dhruvit
0 Kudos
Message 1 of 9
(4,641 Views)
Hi Druvit
 
Why do you want to use a graph and not just use one of this nice numerical indicators? For instance a tank?
 
This is filled with a color and you can easily assign a value.
 
Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 9
(4,636 Views)

You could also use a picture indicator instead. The attached VI shows two possibilities

 

0 Kudos
Message 3 of 9
(4,626 Views)

Hi Thomas,

  I am using a graph because I want to leave the trace even if the rectangle, which i am using as a cursor, comes back to initial value.  i have attached a picture file for your reference.  thank you for your reply.

Dhruvit

0 Kudos
Message 4 of 9
(4,611 Views)
Also, you can define your own control (with rectangle type).  Create a property node for this control. Last, just setup the property (color).
0 Kudos
Message 5 of 9
(4,612 Views)
SImilar to your box, I have produced multi-colour hanging bar plots on an x-y chart by drawing the rectangle with 2 short plots, using property Plot.FillTo between them to add or change the colour using Plot.Color, and no interpolation.
 
To draw the box on an xy chart :
For the y axis, or  sides of the box create a 2 element array with upper and lower values - values duplicated,  and for the x axis another 2 element array with the top and bottom of the box in relation to the x origin.  Bundle each y array with the x array, then join together with build array - you get your cluster of arrays for multiple plots on the x-y chart. 
 
This is a very flexible method that but the explanation above may be a bit complicated, if you would like an example vi, then I'll tidy up what I've got and post it. (Its very application specific at the moment);
 
Lucy
0 Kudos
Message 6 of 9
(4,604 Views)

Hi lucy,

  can you send me your vi file.  i have labview 6, so if you have labview 7 then is it possible for you to save it as labview 6 compatible.  thanks for your help.  i am doing the same thing as you are.

Dhruvit.

0 Kudos
Message 7 of 9
(4,592 Views)
I have attached the vi, but it is in LV7, Sorry I no longer have 6.1 installed. I'll post a picture of it if you can't get it converted.
 
Lucy
0 Kudos
Message 8 of 9
(4,564 Views)

Here is Lucy's code as LV 6.0.

I only go back to LV 6.1 so I could not test this.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 9 of 9
(4,549 Views)