LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph Scaling

Solved!
Go to solution

Hello there.

I was wondering if someone can point me to the right direction with this problem i am facing.

currently, my program read a device data and graph it on the chart.

it takes the date of the first data, the last data and 2 or 4 weeks ago.

i want to calculate the slope of the graph according to what days i want it. 

right now, my x axis from days 143 to 177

on the graph, i change it from 150-170 for instant.

what can i do to get the value of the x axis from the chart?

i hope i am not confusing you with my discriptions.

 

Best regards,
Krispiekream
0 Kudos
Message 1 of 6
(3,647 Views)

i think this is the right direction?

i change x scale to 154 and 169.

how do i get all the data of the array from 154 to 169?

 

Message Edited by krispiekream on 10-07-2008 05:38 PM
Best regards,
Krispiekream
0 Kudos
Message 2 of 6
(3,620 Views)

Well, it looks like you have an xy graph and not a chart.

 

Graphs allow cursors, so one simple way would be to place two cursors and do a linear regression of the data in-between.

 

A very old example can be found here. See if this helps.

Message 3 of 6
(3,603 Views)

no, that didnt helped much.

so everytime i change the scaling values of my x-axis, 

i want the system to calculate the slope between those values.

i need to rearrange/cut my array so that he will take data from 150 to 170 for instant.

 lets say that i have 200 days worth of data.

from day 1 to day 200.

but because of errors in the system. i want to take only the good data.

after looking at all of them. i know that the data from 150 to 170 is good.

i want to use the scaling of 150 to 170 and find the slope of that.

currently, my program take the slope of day 1 to day 200.

 

Best regards,
Krispiekream
0 Kudos
Message 4 of 6
(3,601 Views)
Solution
Accepted by krispiekream
You can use basically the same code, but instead of the cursor positions, use the xmin and xmax. Shouldn't be much different.
Message 5 of 6
(3,598 Views)

you are right as always. that example did helped.

i got one more question.i am working with events structure. 

so when i change the xmin and xmax scale values of the graph. i want it to automatically do the slope.

right now, i click on a button to recalculate the slope and i really don't want to press any button. 

i cant seems to find anyways to add the change of the xmin and xmax values into the event structure?

 

Best regards,
Krispiekream
0 Kudos
Message 6 of 6
(3,556 Views)