Fry
Fry

Reputation: 6275

iOS-Charts space left and right

I want insert space left and right to prevent value label prevent yAxis value. And remove background line under charts. How can I do?

Edit

    self.lineChart.delegate = self;
    self.lineChart.descriptionText = @"";
    self.lineChart.drawGridBackgroundEnabled = NO;
    self.lineChart.scaleXEnabled = NO;
    self.lineChart.scaleYEnabled = NO;
    self.lineChart.leftAxis.spaceTop = 0.30f;

enter image description here

Upvotes: 1

Views: 3064

Answers (3)

Emerson Carpes
Emerson Carpes

Reputation: 71

On Charts 3.0 you can use...

lineChartView.xAxis.spaceMin = 0.2
lineChartView.xAxis.spaceMax = 0.2

...to add some space on left and right.

Upvotes: 2

daniel.gindi
daniel.gindi

Reputation: 3495

To add spacing - you can use Charts 3.0, and adjust xAxis.axisMinimum/xAxis.axisMaximum.

To adjust the background, simply use the UIView's properties of backgroundColor, opaque etc.

To disable the grid - adjust the drawGridLinesEnabled on the axes, as @ashmi123 said.

Upvotes: 0

ashmi123
ashmi123

Reputation: 710

To remove the background line under the charts use below code :

_lineChart.yAxis.drawGridLinesEnabled = NO;
_lineChart.xAxis.drawGridLinesEnabled = NO;

Upvotes: 0

Related Questions