LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

On a chart, can we set portions of a chart with different colors

My application involves with fuel cell conditioning during which the V-I curve with go many cycles. I want to distinguish these cycles with different colors but don't know whether it's doable because I think if we set a color, it will set the whole line with the same color. Or if we can stop the line after one cycle and start the second cycle as a new line, then it will be a new color. Anyone can give some suggestion about how it can work? Thanks in advance.
 
Guangde
0 Kudos
Message 1 of 9
(3,842 Views)
You can do two traces, each with a different color and selectively write NAN to one and the data to the other. See attached.
Message 2 of 9
(3,831 Views)
Hi Altenbach, thank you for your advice. I studied your example. I think if I have only few cycles, it can be a good solution. But my test will run dozens of cycles, it's not practical to have so many NaNs wired to the system. Please let me know if you have any new ideas.
 
Best regards,
 
Guangde
0 Kudos
Message 3 of 9
(3,823 Views)

For unlimited colors, you can use an intensity chart and map your colors into it. (A similar method was used to simulate a multicolor graph (not chart!) using an intensity graph, see MemoryGraph04.vi from from this old thread).

See how far you get. It all depends how much time you want to invest.

(Of course you can also use a picture indicator and do whatever you possibly want.)
Message 4 of 9
(3,817 Views)

Thank you for your example, but it's too complicated to incorporate into my system. Right now, I'm looking into how I can make data line restart as another data line when certain crireria's met. This way, it will be in different color. I haven't figured out how to do it yet.

Best regards,

Guangde

0 Kudos
Message 5 of 9
(3,805 Views)
By bundling multiple points together you can get different plots on a waveform graph.  And +Inf plots nothing.  I attached an example that plots a random number.  When the boolean button is switched, it switches to the other plot line, thus another color.  This was only done for 2 different colors, but the case structure and the cluster could be expanded for more than 2 colors.

Message Edited by Ravens Fan on 08-24-2007 10:43 PM

Download All
0 Kudos
Message 6 of 9
(3,790 Views)


@Ravens Fan wrote:
 And +Inf plots nothing. 

This is incorrect! If you use +inf, it will end the current color with a line going vertically up to infinity (or vertically down for -inf). To plot nothing, you need to plot NaN as in my answer above.
0 Kudos
Message 7 of 9
(3,779 Views)
...as is clearly visible in the plot that was posted...

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 8 of 9
(3,765 Views)


@altenbach wrote:

This is incorrect! If you use +inf, it will end the current color with a line going vertically up to infinity (or vertically down for -inf). To plot nothing, you need to plot NaN as in my answer above.


You're right.  When I was writing up the message, I was looking for a constant Nan on the numeric pallette.  I didn't find it.  I saw +Inf, and I thought, "yeah, that's the same thing".  I didn't notice the lines going off the graph.  I went back and looked for the Nan constant after seeing your message and still couldn't find it.  Then I realized typing Nan into a normal constant worked just fine.

The key thing I was trying to say in the message is that if the user wants to change colors, putting the data for the next color into the next numeric of a cluster to the chart seems to work and putting nothing in for the last plot.  Now with a method like this, I am going to assume that they would need to know the maximum amount of colors they could possibly want, and bundle up a cluster that contains that many numerics.  Replace array subset and using the array to cluster function should make it easier to index the data into the next numeric of the cluster.

0 Kudos
Message 9 of 9
(3,753 Views)