LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

changing the color of a graph dependent on data?

If you want full control over the color, you can map your line into an intensity graph. Simply change Z to change color. Here's a simple example.

0 Kudos
Message 11 of 17
(883 Views)

How do I create an XY plot with only one output coming from the analog channel?

0 Kudos
Message 12 of 17
(858 Views)

@glskinner wrote:

How do I create an XY plot with only one output coming from the analog channel?


Well, if you have only one output, you don't have x and y, but only one of the two. 😮

 

You could e.g. define the timestamp or sequence number as X if you want, but your question is way too open ended at this point. If the data is spaced equally in time, all you need is a waveform graph. How does the data look lile? What do you want to display?

0 Kudos
Message 13 of 17
(841 Views)

The data is a sine wave. I have a boolean control where I start taking measurements of the sine wave after 2 "highs" of my digital in (ttl). The graph is in the run state constantly. I'd like to change the plot color of the sine wave when I start taking measurements. My boss wants to see where the data begins being recorded.

0 Kudos
Message 14 of 17
(831 Views)

@glskinner wrote:

The data is a sine wave.


That seems irrelevant. You still have not answered the important question if the data points are spaced equally. an XY graph is only needed if they are NOT spaced equally in X. Your example code currently has a chart.


@glskinner wrote:

I have a boolean control where I start taking measurements of the sine wave after 2 "highs" of my digital in (ttl). The graph is in the run state constantly. I'd like to change the plot color of the sine wave when I start taking measurements.


Is it automatically detecting these two highs or are you watching and pressing a control manually if this happens? If the code counts the two highs automatically, it should not be a control, right?


@glskinner wrote:

My boss wants to see where the data begins being recorded.


That also seems irrelevant, unless he has a certain kind of color blindness.

 

As has been said before, you simply need a graph with two different plots. make one NaN and the other carryting the data, then switch between the two, depending on state.

 

The example you have attached earlier seems overly complicated and does not make a lot of sense, but you already have a case structure and a chart. All you need is place the chart terminal after the case structure and send the data to one or the other plot while setting one to NaN.

 

Here's a quick draft.

 

 

 

0 Kudos
Message 15 of 17
(822 Views)

hmm, the "waveform components" doesn't plug into my source. It says it's terminals of different types. What am I doing wrong?

0 Kudos
Message 16 of 17
(811 Views)

Sorry, I don't have DAQmx installed, so I don't know what you actually get (you code is broken on my rig). Why don't you set the read function to array instead of waveform, for example?

0 Kudos
Message 17 of 17
(806 Views)