Pre loader

WPF Charrt - Add text annotation to sine wave

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

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.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies