iOS - Daniel Gindi的图表 - 我在折线图中得到了一倍的xAxis!有人遇到过这个问题吗?

时间:2018-03-15 08:47:43

标签: ios swift charts

Notice the xAxis, and it's a doubled line, which is out of my expectation.

顺便说一下,我不想要与xAxis平行的线条。我几乎尝试了每一段代码,但没有人能够擦除平行线。任何建议都将被视为> _<

代码如下。忽略评论中的片段

    data = lineChartData
    chartDescription?.text = ""
    chartDescription?.textColor = UIColor.white
    noDataText = "No Data"
    noDataTextColor = UIColor.white

    // xAxis
    xAxis.valueFormatter = IndexAxisValueFormatter(values: dataPoints)
    xAxis.granularity = 1.0
    xAxis.labelPosition = .bottom
    xAxis.labelTextColor = UIColor.white
    xAxis.drawGridLinesEnabled = false

    // legend
    legend.textColor = UIColor.orange
    legend.verticalAlignment = .top
    legend.horizontalAlignment = .left


    rightAxis.enabled = false

    // touch
    scaleXEnabled = false
    scaleYEnabled = false
    dragEnabled = true

    lineChartDataSet.drawCirclesEnabled = false
    lineChartDataSet.colors = [UIColor.orange]
    lineChartDataSet.valueColors = [UIColor.white]

当我评论关于图表外观的所有代码时,我得到了这个: commented yAxis的末端向下伸展。这是图书馆的错误吗?或者如果我错过了什么......

0 个答案:

没有答案