SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

1
0

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

Version
Current
Images
  • You must to post comments
0
0

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

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.