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];
Surface.Annotations.Add(annotationLine);
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
- Tom Jorgensen asked 1 year ago
- last edited 1 year ago
-
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 login 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 ?
- Nathaniel D answered 1 year ago
- You must login to post comments
Please login first to submit.