Display axis values ​​in BarChart bars of MPAndroidChart library

I am using MPAndroidChart , and want to archive something similar to the following diagram:

HorizontalBarChart with built-in bar labels

Basically, I want to display labels (let’s say, all labels of one of the axes) inside the columns in BarChartor HorizontalBarChart, in addition to the values ​​of the bar itself. The reason is that in my case, the YAxis labels are quite long, so it’s not enough to display them outside the diagram. But inside each bar there is a lot of space guaranteed in my case. Therefore, it is quite reasonable to basically name each bar (which means this bar) directly inside it. I did not find an API for this (I looked in version 2.1.1).

HorizontalBarChart, , BarChart !

? , .

+4
1

, . (, , , ), .

  • XAxis , chart.getXAxis().setPosition(XAxisPosition.BOTTOM_INSIDE)

, . setXOffset(...) setYOffset(...) XAxis.

+6
source

Source: https://habr.com/ru/post/1599549/


All Articles