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?
- Iliya Mashin asked 2 years ago
- last edited 2 years ago
- You must login to post comments
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
- Yura Khariton answered 2 years ago
-
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
-
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 login to post comments
Please login first to submit.