LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How may I vary the color of a part of a curve on a chart

Hello all,

I have a chart and i would like to vary the color of a part of a curve when the user switch a button to "High". Not the whole curve, juste the part corresponding at the time that the button is to "High".

I included a picture of what the curve might looks like for more clarity.

Thanks!

Vincent
Message 1 of 9
(2,899 Views)
Don t use a chart but an XY graph and make 3 plots.

I think this is the only way...

Have fun !

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 2 of 9
(2,884 Views)

It can be done with any type of graph or chart!

The trick is to use "NaN" for any points that should not be ploted.

See Christian's reaply in this thread.

http://forums.ni.com/ni/board/message?board.id=170&message.id=201593&query.id=66663#M201593

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 9
(2,879 Views)
(Ben, how come you get stars for the referral, but I don't for my original post? ;))
 
The above works great of you only need a limited set of colors. If you want many colors or even a color gradient, you can use an intensity graph (or even a picture indicator) but this requires a bit more work.
 
For some ideas, have a look at my MemoryGraph03.vi posted HERE .It could easily be modifed to draw a single trace with varying color.
 
(Bug alert: The VI works fine in 7.0 and 7.1. Please note that LabVIEW 8.0+ has a small bug and all traces will appear white. To fix, you need to change the 256 next to the white color box constant in the cluster above the loop to 255 (or simply change its representation from DBL to U8))).
 
Message 4 of 9
(2,859 Views)
Thanks all for the help,

I will see what I can do from now (pretty sure I will be able to do it with your advices).

Vincent
0 Kudos
Message 5 of 9
(2,846 Views)
Christian wrote
 
"
(Ben, how come you get stars for the referral, but I don't for my original post? )
"
 
Selective marketing! Smiley Wink
 
BTW: When you address Q's like this to me, I will probably respond with some worthless answer forcing YOU to come up with another quality reply in order for you to move into second place.
 
So...
 
Until you have have "done the deed" you may want to think twice about teasing the "teddy bear".
 
Ben
 
Savoring his final days in the sun of second place.
 
Maybe I should start writing my book "Life in the Shadow of Dennis".
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 9
(2,829 Views)
Christian,

I just give you a few stars to even things... 😉
Message 7 of 9
(2,826 Views)
You can also split your array into pieces, one piece for each contiguous color, and plot as three (or more) traces with different colors.  This is useful for large data applications.  To make it work, you need to specify the starting value by either using a waveform or the t0/dt/Y cluster input to the graph.  You also need to unset the graph property Ignore Timestamp (pop up on the graph away from the axes to find it - you will need to have a waveform/cluster input for it to be present).  After you unset Ignore Timestamp, you will then need to reformat the X-axis into reasonable values.

You can see an example of this in the code for this tutorial.
0 Kudos
Message 8 of 9
(2,774 Views)
Sounds nice! I will have a look at this tutorial.

Thanks!
0 Kudos
Message 9 of 9
(2,758 Views)