Pre loader

Adding annotations synchronously

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 have a method that adds a marker line to my chart. The issue I have it that calling this method results in a non-blocking async call but in other code where I call this, I want to access the markers immediately after adding the marker. Is there a way to call Annotations.Add synchronously?

public void CreateNewMarker(DateTime markerDate, Color color)
{
try
{
MainChart.Annotations.Add(new VerticalLineAnnotation()
{
Stroke = new SolidColorBrush(color),
StrokeThickness = 1,
X1 = markerDate,
StrokeDashArray = new DoubleCollection(new List { 6, 3 }),
IsEditable = false
});
}
catch (Exception ex)
{
Tracing.TraceError(piuModule, className + “.CreateNewMarker()”, “Error during the CreateNewMarker() method”, ex);
}
}

Other Method
{
calls CreateNewMarker(0
Access new marker Annotations by index, MainChart.Annotations[markerIndex].X1

}

Version
2.2
  • You must to post comments
0
0

Hi Raymond,

Thanks for your inquiry.
I am sorry for the misunderstanding. Adding Annotations is always a synchronous (blocking) call that is done in a UI thread.
You should be able to access the new annotation immediately after adding it.

We have also noticed there is no valid license assigned to your account.

If you wish to continue receiving technical support further please consider renewing your support subscription.
To do that please contact Sales here:
https://www.scichart.com/contact-us/

Or email us at [email protected]

If you believe this is not correct please provide your new order details.

  • 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