2

I am trying to give my chart some top and bottom spacing, so it won't appear as on the picture below.

 in

Is there any way to set either maximum height or add a padding, so the label(in this case -1) won't collide with the date?

Thank you.

Matti
  • 433
  • 6
  • 10

3 Answers3

10

Try ChartView.extraBottomOffset = 40

1

Currently there is no such offset available yet, take a look at internal func drawLabels, this is how it calculates the position. You can change yourself for now. But I think it's more like a bug, which happens with negative values, I filed a bug on github https://github.com/danielgindi/ios-charts/issues/481.

Wingzero
  • 9,644
  • 10
  • 39
  • 80
0

There is also the option to change the spacing between the bottom of the bar chart and the label with chartView.xAxis.yOffset = 10

CristianMoisei
  • 2,071
  • 2
  • 22
  • 28