gpt4 book ai didi

ios - 如何删除 LineChartView iOS 图表中的点

转载 作者:搜寻专家 更新时间:2023-10-30 22:24:38 25 4
gpt4 key购买 nike

我在学习ios-charts .我正在使用找到的教程 here .第一张图片显示了我得到的结果。你如何去除蓝色圆点,使其只显示像第二张图片中所示的平滑线? This is the result I am getting

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

}

}

最佳答案

.setDrawCircles = NO;LineDataSet 设置为禁用圆的绘制。

它在维基上...
https://github.com/PhilJay/MPAndroidChart/wiki/DataSet-classes-in-detail

关于ios - 如何删除 LineChartView iOS 图表中的点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37268107/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com