5

Is it possible to change labels on X axis during zooming in MPAndroidChart ? I want to have years as labels at the beginning, than change into months when zooming, then week (labels will become more accurate when zoom).

bizon
  • 125
  • 3
  • 10

1 Answers1

10

This feature just became available, please check out the AxisValueFormatter interface.

It allows to dynamically adjust axis labels before drawing them which means you can write your own logic and decide what get's displayed and what not. Always bear in mind that performance is critical here as methods of this interface are invoked (potentially) thousands of times when drawing the chart. Especially avoid unnecessary memory allocations or expensive loops.

Philipp Jahoda
  • 50,880
  • 24
  • 180
  • 187
  • Thanks for proper answer with proper reference! – Sjd Oct 01 '18 at 14:04
  • 1
    He should be able to give the proper answer, since he made the library ;) – Carson Holzheimer Feb 10 '19 at 13:24
  • Hi @Philipp Jahoda , can you please answer my bounty question regarding xAxis labels https://stackoverflow.com/questions/55325511/mpandroid-chart-not-displaying-any-labels-for-xaxis-what-is-missing?noredirect=1#comment97407907_55325511 – Deep Shah Mar 27 '19 at 04:54