LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

change line color if over limit while using plotY as stripchart

I am using PLOTY to make a strip chart graph. a new data point comes in every minute. I would like the LINE COLOR to change to RED if the datapoint exceeds a limit, then return to green if the following point is below the limit. I can only think to use multiple PLOTY calls with different data arrays, but that seems like a nightmare if the data wanders back and forth around the limit.
Any ideas?

thanks
0 Kudos
Message 1 of 2
(2,786 Views)
In message <506500000008000000B2A00000-1042324653000@exchange.ni.com>,
bilg writes
>I am using PLOTY to make a strip chart graph. a new data point comes
>in every minute. I would like the LINE COLOR to change to RED if the
>datapoint exceeds a limit, then return to green if the following point
>is below the limit. I can only think to use multiple PLOTY calls with
>different data arrays, but that seems like a nightmare if the data
>wanders back and forth around the limit.
>Any ideas?
>
>thanks

This isn't exactly what you have asked for but it may do the job.

1. Use a graphics editor to create a background image for your strip
chart. The image should be the same size as the chart. It should consist
of two colour bands (say red and green) ar
ranged with the red above the
green.

2. Create a canvas control and load your image into it.

3. Use the z-plane controls to ensure the canvas is behind the chart.

4. Put chart on top of the canvas.

5. Set the chart background & frame colours to transparent.

This gives the effect of a red zone and a green zone for the chart
background. The plot line doesn't change colour but it does move in and
out of the red portion.

By adding a couple of decorations you can get a reasonable looking
chart.

It's a bit of a fiddle but it does work and once set-up you can just use
PLOTY as normal.

I've attached a sample UIR.
Download All
0 Kudos
Message 2 of 2
(2,786 Views)