1

I need to give the x-axis labels more space. Is this possible?

If you see the green box, the axis' labels are cut off.

I have tried this but with no effect:

xAxis.labelHeight = CGFloat(40)

enter image description here

I just added the colors to show the areas.

Thanks.

DevB2F
  • 4,674
  • 4
  • 36
  • 60
diogenes
  • 1,865
  • 3
  • 24
  • 51

2 Answers2

2

You can try this solutions for give more space to labels in charts

yourGraphView.setViewPortOffsets(left: 35, top: 15, right: 20, bottom: 30)

It will set offset of view in charts.

Hope this will help you.

kchopda
  • 312
  • 4
  • 16
1

I found a way to add padding around the whole chart and that gave the labels the space to show properly.

Chart.minOffset = CGFloat(20.0)

I hope this helps.

diogenes
  • 1,865
  • 3
  • 24
  • 51