Search code examples
iosswiftios-charts

yValues position on a BarChart


I am developing a Swift 4 application and am using the Charts 3.0.4 cocoapod. I managed to draw a BarChart but now I want to put the values of each bar within the bar itself. I find how to change the font of the values by using the .setValueFont method of the BarCharDataSet but I am not able to find how to change their positions.

Please take a look at the images for better understanding! Thanks in advance!

Currently: Currently

Goal: Goal


Solution

  • Add this line:

    chart.drawValueAboveBarEnabled = false