LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Static Trendlines to existing XY Plot

Hey All,

 

I am attempting to implement some new code in an existing VI.  I currently have the ability to create an XY plot that "builds" whenever a button is pressed.  This works fine, but the data that ends up on the chart is somewhat useless without a reference line.

 

This will be used for DAQ work.  So hypothetically, I could have 5 strain gages hooked up to this chart. On the chart, I plot strain as a function of displacement.  The relationship should be linear.  As such, when I collect data at different points throughout the range, I should have points that more or less follow an expected linear function (aka a nice, straight line)

 

I have the data to create this "expected trendline", it is simply two points.  However, I cannot seem to come up with a simple way to both:

  • Keep my existing plot, which adds "live" data each time I press the boolean.
  • Add "static" (dead) trendlines to the plot that will always be present

I've tried a number of fixes, but each seems to get out of control.  For example, I created 10 different arrays, each containing the X or Y points to create the 5 different static trendlines, and then attempted to combine this with the existing chart, but the shear number of arrays seemed ridiculous.  Any advice would be much appreciated-

 

Below shows what I desire, and the current code I am working with.

 

 

This is my current plot.  Highlighted points in the top right and left show what I can currently create, these are "live" data points.  I'd like to be able to add in the "dead" static trendlines, shown in red and blue (poorly drawn in...)

 

Desired Plot.JPG

 

 

 

The code I have, for the plot that "builds" with the press of a button, creating the points shown highlighted in the image above:

With Template Lines.JPG

0 Kudos
Message 1 of 2
(2,720 Views)

Hi hatchling,

 

each plot needs its own dataset - just add it!

 

For your two lines you need to add just 2 points each as you use a XY graph…

Best regards,
GerdW


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