Pre loader

Vertical annotations not displaying on the chart

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


I’m having issues with displaying my vertical annotations on my chart. Below is the code for creating the annotation and adding it to the chart.

var annotationLine = new VerticalLineAnnotation();
annotationLine.XAxisId = XAxisID;
annotationLine.YAxisId = YAxisID;
annotationLine.Stroke = new SolidColorBrush(Colors.Blue);
annotationLine.StrokeThickness = 2;
annotationLine.IsHidden = false;
annotationLine.AnnotationCanvas = AnnotationCanvas.BelowChart;
annotationLine.Y1 = 0;
annotationLine.Y2 = ControlHeight;
annotationLine.X1 = xValues[i];

I have verified that the XAxisId and the YAxisId are correct and match the id of the only axes that I have on the chart
I have verified that the xValues[i] is a valid value on the chart and within the bounds of the viewport

The tricky part here is that I am reading live streaming EEG data from a device and inserting manual triggers into the data. This works fine and the annotations appear in the chart as they are within the bounds of the chart.
I then record that data to a file (currently csv but will be doing EDF as soon as I get this figured out) where the annotation data is present (verified)
It’s when I try to read the file into my application that I can’t get the annotations to appear on the SciChart. I’m using the code above for both the live streaming data (working) and the file reading (not working) so I’m really baffled by this and could use any insight anyone has.

Thank you

Version 6
  • Andrew Burnett-Thompson
    Hi Tom, use the code button at the top of the forum when editing/asking a question to indent 4 spaces. This will format your code sample with syntax highlighting.
  • You must to post comments

Hello Tom Jorgensen,

Can you try to remove\change this line of code and check if it draw at least anything?

annotationLine.AnnotationCanvas = AnnotationCanvas.BelowChart;

As it may hide your annotation below the chart, and if your SciChartSurface background, or bands are not transparent\half transparent it may not be visible under it.

It’s strange that the same code works for live, but not for reading. Can you check an output window if there are any error messages ?

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.