LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with changing chart "on the fly"

Hi

Im sampling some data "on the fly" as showed in attachment, but can't make it look as how my customer want it 😞

As you can see, I sample a (red) value. And when the value reach above a limit (green dotted line at 3), the sample above the limit shall turn color.

I also need to "mark" the highest level, with a extra width line.

I have tried a lot of different things, but always ending up with changing the color for the entire sample.

I have also tried with multiple charts, and some differrent enable/disable settings - but get stucked again. 

Can anybody provide me, with a clue on how to solve this. Or even better, an example? 🙂

 

Many thanks..

 

 

0 Kudos
Message 1 of 9
(3,080 Views)

You are going to have to "Cheat" just a bit.

 

Use three plots: one will have all NaNs except for the maxima and a thick width.  One will have all nans except for the values >= your threshold and the same color as the first but a thiner line.  the last will contain NaNs except for the points you want the other color


"Should be" isn't "Is" -Jay
Message 2 of 9
(3,061 Views)

Here's an example with one of your requirement.

 

graph.png

Message 3 of 9
(3,057 Views)

You also need to decide what to do when there is only one sample going over the limit.

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

Nice example!

 


@Michel_Gauvin wrote:

You also need to decide what to do when there is only one sample going over the limit.


Cheat again,  double up every point and change the plot style back to the default.


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 9
(3,044 Views)

NaNs are not plotted? Well I didn't realise that! 🙂

All sorts of handy possibilities spring to mind.

Message 6 of 9
(3,039 Views)

It does afford some nifty tricks.  And just how would you plot a NaN?  Its not a number.


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 9
(3,030 Views)

Like so many things, totally obvious when you see it. Its just that that particular wood was hidden in the trees! Smiley Very Happy

0 Kudos
Message 8 of 9
(3,025 Views)

See also this very old discussion.

 

A chart might be a bit problematic, because in order to plot the thicker line you need more than one consecutive point above the limit and you would thus need to know the value of one point in the future. If the chart update is relatively fast, you could delat the plotting by one point, for example.

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