Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MPAndroidChart - dynamic date labels on X axis

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).

like image 847
bizon Avatar asked Sep 14 '15 13:09

bizon


1 Answers

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.

like image 118
Philipp Jahoda Avatar answered Sep 20 '22 08:09

Philipp Jahoda