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

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.