How are value pairs matched?
- Last UpdatedJul 17, 2024
- 2 minute read
To plot a data point, the scatter plot must determine which Y value belongs to a given value of the X axis tag and vice versa. This is easy if there are data samples available with the same time stamp for both the X axis tag and the Y axis tag. If there is a sample available for one tag (Tag 1) at time T, but not for the other tag (Tag 2), the missing value is calculated based on the following rules:
-
If Tag 2 uses a curve type of "Point" or "Step Line", then the data point uses the latest sample of Tag 2 that is earlier than T.
-
If Tag 2 uses a curve type of "Line", then the data point uses the result of a linear interpolation between the two samples of Tag 2 that surround T.
For example, assume you have the following samples available for two tags. Tag 1 uses a trace type of "Step Line." Tag 2 uses a trace type of "Line." A dash indicates that there is no sample at that point in time.
|
Time |
Value of Tag 1 |
Value of Tag 2 |
|---|---|---|
|
t1 |
xt1 |
yt1 |
|
t2 |
— |
yt2 |
|
t3 |
xt3 |
— |
|
t4 |
xt4 |
yt4 |
According to the rules above, the missing value of Tag 1 at t2 is assumed to be xt1. The missing value of Tag 2 at t3 is calculated using a linear interpolation between yt2 and yt4.
If either tag has a NULL sample at a given point in time, the data point is considered "empty," which may result in a gap in the curve.