Ash
Ash

Reputation: 149

Issue in display of barchart with latest ioscharts

I updated ios-charts to the latest code after 2 months. I see lot of difference when I run the code.

This is before updating the library:

enter image description here

After updating:

enter image description here

Here's the code that generates the chart:

    chart.infoTextColor = UIColor.blackColor()

        chart.backgroundColor = UIColor.whiteColor()
        chart.descriptionText = ""
        chart.noDataText = "Loading..."
        chart.rightAxis.enabled = false
        chart.xAxis.wordWrapEnabled = true

        chart.legend.position = .BelowChartCenter;
        chart.legend.form = .Circle;
        chart.legend.formSize = 10.0;
        chart.legend.formToTextSpace = 10.0;
        chart.legend.xEntrySpace = 4.0;
        chart.legend.yEntrySpace = 2.0
        chart.legend.stackSpace = 5.0
        chart.legend.textColor = UIColor.blueColor()

        chart.xAxis.gridColor = UIColor.blueColor()
//        chart.xAxis.axisLineColor = UIColor.blueColor()

        chart.gridBackgroundColor = UIColor.whiteColor()
        chart.borderColor = UIColor.redColor()

//        chart.xAxis.labelHeight = 18
//        chart.xAxis.labelWidth = 18
        chart.xAxis.labelPosition = .Bottom;
        chart.xAxis.drawGridLinesEnabled = false;

        chart.rightAxis.drawGridLinesEnabled = false;

        //zooming..
        chart.pinchZoomEnabled = false
        chart.doubleTapToZoomEnabled = false
        chart.scaleXEnabled = false
        chart.scaleYEnabled = false

        //new..
        chart.leftAxis.labelPosition = .InsideChart
chartDataSet.barSpace = 0.38

Upvotes: 2

Views: 555

Answers (1)

Wingzero
Wingzero

Reputation: 9754

Latest release has deprecated startAtZeroEnabled, which seems is your case.

Please try set customAxisMin to get the expcted range. e.g. customAxisMin = 0

remember to set it before calling chartView.data = yourData, or you need to specificly call chartView.notifyDataSetChanged()

Upvotes: 1

Related Questions