Pre loader

MVVM + CategoryLabelProviderBase

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

What is the best way to form List with my formatted dates in the View Model and just put in my implementation of CategoryLabelProviderBase?

Can an AxisBase implementation help me in this case?

Version
4.3.0.4646
  • You must to post comments
0
0

Hi Iliya,

Well axes and its components are parts of UI, so in MVVM they should be considered part of View layer and storing it in ViewModel would be bad idea. If you need to assign some predefined map where you map major tick value on formatted strings, then the easiest way would be to create custom LabelProvider, add public property or method for setting this map into it and use it when your ViewModel changed and you update View layer with latest values from ViewModel ( e.g. in observe() callback for LiveData ).

Best regards,
Yura

  • Iliya Mashin
    Thank you! It could be in VM. It’s data and it stores in VM. A view only renders it. I don’t use LiveData. I use subjects in RxJava. It doesn’t matter. Can you provide some code? What the class exactly I have to implement. And what do I have to do in it. I tried override updateTickLabels and put there my array and it haven’t helped me
  • Iliya Mashin
    And if I format my dates in my label provider how will I be able to control changing from HH:mm format to DD MMM HH:mm format when I scroll my chart to the oldest dates?
  • 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