2016-05-17 65 views
2

我在學習ios-charts。我正在使用教程發現here。第一張圖片顯示了我得到的結果。你如何去除藍色的圓點,以便它只顯示如第二張圖片所示的平滑線條? This is the result I am getting如何刪除LineChartView iOS圖表中的點

This is what I am trying to get

下面是代碼

import UIKit 
import Charts 

class ChartsViewController: UIViewController { 

@IBOutlet weak var lineChartView: LineChartView! 

override func viewDidLoad() { 
    super.viewDidLoad() 

    // Do any additional setup after loading the view. 

    let months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"] 
    let unitsSold = [20.0, 4.0, 6.0, 3.0, 12.0, 16.0] 

    setChart(months, values: unitsSold) 

} 

func setChart(dataPoints: [String], values: [Double]) { 

    var dataEntries: [ChartDataEntry] = [] 

    for i in 0..<dataPoints.count { 
     let dataEntry = ChartDataEntry(value: values[i], xIndex: i) 
     dataEntries.append(dataEntry) 
    } 

    let lineChartDataSet = LineChartDataSet(yVals: dataEntries, label: "Units Sold") 
    let lineChartData = LineChartData(xVals: dataPoints, dataSet: lineChartDataSet) 
    lineChartView.data = lineChartData 

} 

} 

回答

-2
lineChartDataSet.circleRadius = 0 
0

刪除圓線

lineChartDataSet.drawCirclesEnabled = false 

了一圈

lineChartData.drawValuesEnabled = false