LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Draw text on Waveform Chart Plot

Solved!
Go to solution

1) Yes, my chart will eventually run out of room to store new data points. However, I have set the History to a larger size than is required so that the amount of History I need is actually available.

 

2)Yes, the entire data set gets plotted every second. Old data scooches 1 second to the left (while still being displayed) and the new data point is added. Or more accurately new data must be added every second, while still displaying all old data. 

 

3) I'm not sure of the complete innerworkings of the chart, whether it redraws all data at each update or it transforms the data to an "image" and just updates the "image"

 

Regardless of How it works, it does work. I have tested it with both the chart and the graph and the chart handles the updates without issue and "redraws" all data very quickly. Certianly much quicker than the graph can handle.

 

I've worked with charts and graphs in the past with .Net, and I know that its chart control doesn't actually redraw every data point at each update. It takes the data as it comes in, appends an "image" of that new data to an "image" of the old data and then displays the new "image".... which is why it's so fast. It doesn't have to plot each data point, all its doing is displaying an image of that data.

 

Edit: Spelling

0 Kudos
Message 21 of 25
(1,247 Views)

2)Yes, the entire data set gets plotted every second. Old data scooches 1 second to the left (while still being displayed) and the new data point is added. Or more accurately new data must be added every second, while still displaying all old data. 


But it doesn't dispaly all old data.  It displays the subset of old data that fits within the plot area.  The special case is if you set up your plot to have exactly the same display length as your history.

 


3) I'm not sure of the complete innerworkings of the chart, whether it redraws all data at each update or it transforms the data to an "image" and just updates the "image"

 

Regardless of How it works, it does work. I have tested it with both the chart and the graph and the chart handles the updates without issue and "redraws" all data very quickly. Certianly much quicker than the graph can handle.

 

I've worked with charts and graphs in the past with .Net, and I know that its chart control doesn't actually redraw every data point at each update. It takes the data as it comes in, appends an "image" of that new data to an "image" of the old data and then displays the new "image".... which is why it's so fast. It doesn't have to plot each data point, all its doing is displaying an image of that data.


Okay, I was thinking that might be the case.  If it can simply update some aspects of the image instead of having to regenerate the entire image, then it would be faster.  I do not know if there is a way to get a graph to draw efficiently.



0 Kudos
Message 22 of 25
(1,240 Views)

@VItan wrote:

But it doesn't dispaly all old data.  It displays the subset of old data that fits within the plot area.  The special case is if you set up your plot to have exactly the same display length as your history.

 


Ya, the X axis re-scales every second so that its min is 0 and its max is "however many data points i have"

 

 

I am currently working on a solution based on your earlier suggestion, and It looks like it will work.

 

If it does work out, I will be able to have a chart that:

  • Has a cursor-like feature that displays the value of the Y data at the X interval that I click the mouse on
  • Has the ability to display "annotations" or comments

I'll keep you updated!

 

0 Kudos
Message 23 of 25
(1,235 Views)

VItan your suggestion worked.

 

I created a transparent image over the chart plot (resize and reposition on the VI's resize event), and used its mousdown event to give me the value at click, and commenting features i needed.

 

The scales are opposite (Chart goes from 100 to 0 - top to bottom lets say, and the picture is from 0 to 100 - top to bottom)  so I had to do some initial scaling calculations and some additional scaling  on the Scale Change, and Auto Scale Change events, to make sure it all lines up as the chart moves around.

 

Thanks again for your help

0 Kudos
Message 24 of 25
(1,205 Views)

Did you have any scrolling of your annotations?  If so, can you post what you did?  I would love to see it.

 

Early on, I was inferring that you were only showing a subset of your data on the chart and would have to deal with scrolling your annotations off of the visible picture, meaning you would have to have considerations for handling it (I came up with two ways - moving the picture's origin property while keeping track of where you put annotations so that you can resize or reinitialize the picture when they aren't visible anymore to avoid the picture growing forever; and converting to pixmap and sliding pixels over, much more expensive but it works).

 

With a non-scrolling chart, maybe you are just dropping annotations on it that don't move, though...



0 Kudos
Message 25 of 25
(1,193 Views)