LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the plot name by clicking the chart?

Hi

 

Actually I'm not sure if I can express my question clearly, but I'll try my best.

I have to record hundreds of temperature data, and plot them in a waveform chart.

In simplicity, like the following chart...

20150825001.png

Imagine there are hundreds of plots on the chart, it is hard to tell which plot is of interest.

For example, if there is a plot referring to noise, and the user would like to uncheck its visibility checkbox.

But it is easy to see which curve in the chart but hard to know which plot in the legend.

If I can click the plot curve and it shows a tip of its plot name, it will be helpful to know what plot name the curve is.

Is there any method I can do to work out the function? Thanks a lot!!!

 

0 Kudos
Message 1 of 7
(4,212 Views)

Hi William,

 

with a chart you're limited, use graphs instead!

 

You can:

- get the mouseclick positions, find the coordinates in the graph, find the nearest plot for those coordinates: check it's label

- use cursors, snap them to nearest plot: check the label of the plot

 

It's all done using properties/methods of the graph!

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 7
(4,194 Views)

Hi GerdW

 

Very appreciate your advice!

Is the first suggestion realized by coding in the block-diagram, not by direct manipulation in the user interface like second suggestion?

However, I'm not sure how to transform the chart to XY Graph efficiently.

First I tried as belows,

 

20150828001.png

 

It is not updated synchronously among the three plots, and then I tried as belows,

 

20150828002.png

My issue is I have to get one data point for each channel(up to hundreds) periodically.

Is there better way to do it?

I have another wondering about the undefined size of the array.

If I expand the array without define its size initially, it will harm the memory manipulation(??)

In chart, I can set the Chart History Length(I don't know if it helps or not), but I cannot allocate a defined size of array to insert my data here.

If I use the way in the above images, would my application run slower and slower as the time goes?

I hope my expression is not too poor to understand...

Can you give me some suggestions? Thanks very much!!!

0 Kudos
Message 3 of 7
(4,140 Views)

You can define 2 dimensional array to keep all data (instead of history length), then replace column with new data.

Also, if your time step is constant, you can use waveforms instead of XY (not to keep x for each graph - that doubles amount of data).

 

First option (if you have your data arrays and use Map Coordinates to XY method) works for charts. Scrolling is intrinsic for them and on my experience is smoother than rotating waveform or XY.

 

My larger concern is displaying hundreds of channels on one graph. Are you sure they will be distinguishable?

I personally do not like LabVIEW graph performance, especially when they start scrolling in real-time. I strongly recommend to check performance of graphs display at real speeds and amounts of data before adding advanced UI features.

Message 4 of 7
(4,119 Views)

Hi Alexander_Sobolev,

 

Thanks to your suggestion!!!

Do you mean I can initialize an 2 dimensional array with a pre-defined size?

20150829001.png

I'd tried to initialize an array and replace the element, but it has the default values 0, and will be shown on the graph as well.

 

Using the waveform graph instead of XY graph is quite great way to get rid of doubling the data and additional array treatment.

(I directly consider XY graph first since I have a problem of displaying data with uneven x interval.)

 

20150829002.png

 

Very thanks for pointing out the method of Map Coordinates to XY method, I now understand the first option of GerdW's.

 

Actually the "hundreds" is a little exaggerated, the fact is we have 100~200 thermocouples and acquire the data every 10 seconds.

Still numerous?? I guess the user is just want to monitor all of them are in reasonable range and keep stable, and if there is a unexpected behavior of some plot, they can start to examine.

Using chart is still the easier way for displaying my data, do you feel confused why there is no cursor function in the waveform chart control???

 

 

 

0 Kudos
Message 5 of 7
(4,100 Views)

Are you trying to do something like this with your LabVIEW Chart?

Labelled Chart.png

I'm plotting data coming from (in my case up to about 24) named channels of data.  The data come as an array of (up to) 24 values, but I have a separate array that contains the channel names.  When I create the plot, I use the array of names to replace the names on the Plot legend from Plot 1, Plot 2, etc. to the respective channel names.  In my original version, I had an array of booleans to let me turn individual plots on and off, but I replaced it with an array of Scale Factors (shown to the left of the plot names) and adopted the convention that setting the scale to 0 turns the plot off.

 

Here's the code I run before I start sending data to the Chart.  It shows how to access the "channels" of the Chart, set the Plot Name accordingly, set the color of the plot (if you want -- you can also use LabVIEW's default settings), and set additional properties. 

 

Set Plot Name.png

 

Bob Schor

0 Kudos
Message 6 of 7
(4,068 Views)

You can initialize with Nan, then points will not be shown on the graph, though they will be hidden and will affect x scaling. Either manually set x limits, or subarray.

200 graphs, 5 pixels between them (full screen graph) if they are distributed evenly. Rainbow stripe. Also, the first graph is displayed on top and hides graphs under it - if last graph has changed, the stripe will cover the change, you will not see it. To see bad graph reliably, the deviation should be larger than range of all graphs near it.   If all graphs are displayed and temperature is stable, I would subtract average - so that basic level for all is at 0. Obviously automatic processing is necessary - alert if temperature changed more than threshold. And splitting into groups (<30 full screen) to see small changes that can not be found automatically

 

Yes, charts are nice, but absence of cursors makes them rarely usable and adds a lot of work.

0 Kudos
Message 7 of 7
(4,015 Views)