Hi – I have a scrolling sine wave and would like to put a numeric value at the high point of each peak. Is this possible? I’ve attached a pic of what I need. ty
- Paul Richardson asked 7 years ago
- You must login to post comments
Hi Paul
Apologies this question got missed!
We actually have a tutorial on — adding annotations to a sine wave — would you believe it!
Please have a look at that. Note you will have to calculate the maximum points in the sine wave yourself.
To do this, every time you update data you will need to iterate over the points in the viewport to calculate the maxima. The points in the viewport are found by:
var xAxisRange = XAxis.VisibleRange;
var xIndexRange = DataSeries.GetIndicesRange(xAxisRange);
// xIndexRange contains the Min, Max index to the data series.
// use
double yMax = double.MinValue;
for (int i = xIndexRange.Min; i < indexRange.Max; i++)
{
double yValue = (double)DataSeries.YValues[i];
yMax = Math.Max(yValue, yMax);
}
Let me know if this helps!
Best regards,
Andrew
- Andrew Burnett-Thompson answered 7 years ago
- You must login to post comments
Please login first to submit.