Pre loader

1

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

All Answers » Re: Not able to add Text Annotation to annotation collection. » Comments for "Re: Not able to add Text Annotation to annotation collection."
  • Ashvij
    Is it compulsory to add annotations in the constructor itself?
  • Andrew Burnett-Thompson
    Of course not, this is just an example! What’s important is you bind to collection of IAnnotationViewModel, not AnnotationCollection.
  • Ashvij
    I tried this way, but it doesn’t show the annotations, also the line series is not coming out properly after I added the annotations. May be it’s because of Axes Id , but I am not sure. Just to give you the context, I am adding the annotations in a for loop which is within a timer function. Would be great if you could help me with this.
  • Andrew Burnett-Thompson
    No idea how to help, because I can’t see your code :P
  • Ashvij
    From the testing that I have done till now, one thing I got to know is that if I add the annotations in the constructor of my view model , it works fine, but if I add the annotations in my timer function (in a loop) it won’t work.
  • Andrew Burnett-Thompson
    It shouldn’t matter where you add them. I would suggest following our tutorial on adding annotations with mvvm to better understand this api https://www.scichart.com/documentation/v5.x/Tutorial%2007b%20-%20Adding%20Annotations%20with%20MVVM.html
  • Ashvij
    Thanks for the help. I think the problem is that I want to add a collection of annotations every time I update the line series in a timer (dynamically) and I guess that is not possible with annotations in scichart.
  • Ashvij
    I had one small query… In the tutorial 07b – Adding Annotations with MVVM , how is the ObservableCollection(IAnnotationViewModel) Annotations bound to xaml code, cause I am getting a blank scichart surface on adding the annotations through this – Annotations=”{s:AnnotationsBinding Annotations}”?
  • Andrew Burnett-Thompson
    Blank chart can be debugged by going through our troubleshooting. http://support.scichart.com/index.php?/Knowledgebase/Article/View/17247/36/help-my-chart-is-blank-why-doesnt-scichart-render. The tutorial code works so there must be a problem on your side?