LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get the x-value of first (or last) element in history-data of a chart?

Hello there
is there a way to get the x-value of the first or last element in the history-data of a chart? I can retrieve the offset of the chart and the left an right borders of the visible range. as long as the history-buffer is not full i can calculate the x-value of the last element using offset of the x-axes and the size of the history. but when the history-buffer is full this dosn't work any more. How can I get the x-value of the first (or last) element in the history in these cases?

thanks
chrisger
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 1 of 2
(2,407 Views)
Hi Chrisger,

If you don't have an X scrollbar, the last element in the history should always have the X value XScale.Range:Maximum.
Then this formula should bring you the X value for the first element in the history buffer:

XScale.Range:Maximum - (HistoryLength * XScale.Multiplier)

If you are using a scrollbar, then I can see no way of calculating the correct X values, since you cannot read the scrollbar's position.

The best way to solve this problem is propably to track the number of data points while writing to the diagramm. Then you don't need any X scale information from the diagramm, you just use it's history buffer to store your data.

Richard H.
National Instruments
0 Kudos
Message 2 of 2
(2,407 Views)