Charts: How to set the position of the values top on BarChartView?

Created on 29 Aug 2017  ·  3Comments  ·  Source: danielgindi/Charts

Today,our company has required me to change the position of the values top on BarChartView?And now I have no idea ,how to get it....

Most helpful comment

in the file

capture d ecran 2017-08-29 a 17 03 48

modify the line 439

capture d ecran 2017-08-29 a 17 04 06

and in your controller

    chartView.drawValueAboveBarEnabled = true

capture d ecran 2017-08-29 a 17 04 49

All 3 comments

in the file

capture d ecran 2017-08-29 a 17 03 48

modify the line 439

capture d ecran 2017-08-29 a 17 04 06

and in your controller

    chartView.drawValueAboveBarEnabled = true

capture d ecran 2017-08-29 a 17 04 49

@thierryH91200 nice job for pointing in the right direction

@guanyanlin you can also subclass BarChartRenderer and copy the function that contains the posOffset into your subclass and override it there, that way you won't modify the original source code and any future updates in Charts won't wipe out your modifications.

great people are helping :)

Was this page helpful?
0 / 5 - 0 ratings