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


I am trying to chart time series data with one X axis and multiple YAxis, as well as this i am using a vertical line and text box annotation to mark the timestamp when an event occurred. The problem i am having is that the milliseconds portion of the annotation timestamp is being ignored and the annotation is snapping to the the major grid line on the whole second which leads to an misinterpretation by users where the actual event occurred.

In the attached image the event timestamp is 18:13.496 but the annotation is drawn at 18:13.000 exactly. See the thin blue line with 420207 text above. The line should sit nearly at the right border of the chart.

the timestamp (defined as triggerTime) correctly includes the millisecond portion.

The annotations are added as such…

sciChartSurface.Annotations.Add(new TextAnnotation {
Text = EventCode,
FontSize = 10,
XAxisId = “DefaultXAxis”,
X1 = triggerTime,
Y1 = 9.0});

sciChartSurface.Annotations.Add(new VerticalLineAnnotation{
LabelPlacement = LabelPlacement.Auto,
Stroke = Brushes.CornflowerBlue,
XAxisId = “DefaultXAxis”,
X1 = triggerTime,
Y1 = 9.0,
StrokeThickness = 1,
IsEditable = false,
ShowLabel = false,
VerticalAlignment = VerticalAlignment.Bottom });

And my xaxis defined as…

var xAxis = new DateTimeAxis() {
Id = “DefaultXAxis”,
TextFormatting = “dd-MMM-yyyy HH:mm:ss.fff”,
SubDayTextFormatting = StringExtentions.TimeSpanToTextFormatting(last – start),
AutoRange = AutoRange.Once,
VisibleRange = new DateRange(start, end),
GrowBy = new DoubleRange(0.01,0.01),
AxisAlignment = AxisAlignment.Bottom,
AutoTicks = true,
MinorsPerMajor = 5,
IsPrimaryAxis = true,
AxisTitle = “Time,” };

When debugging and looking at the SciChartSurface.Annotations.X1 value, it contains the millisecond value.

Any assistance is greatly appreciated.
Best regards

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.