Pre loader

Annotations X1 position ignoring milliseconds

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

0
0

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
Alex

Version
6.2.1
Images
  • You must to post comments
Showing 0 results
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