我正在尝试使用500值为我的应用绘制类似于我的应用程序的正态分布图的Area图,我进入了这个https://github.com/danielgindi/Charts,但是它并未正确显示,它只显示了图的一部分 如果有人可以告诉我我在做什么错了,那是我的代码
func updateGraph(line: LineChartView,
prices xs: [Double],
fit ys: [Double])
{
var lineChartEntry = [ChartDataEntry]()
for i in 0..<xs.count {
let value = ChartDataEntry(x: xs[i], y: ys[i])
lineChartEntry.append(value)
}
let lineDataSet = LineChartDataSet(values: lineChartEntry, label: "Probability")
lineDataSet.colors = [UIColor.blue]
lineDataSet.drawCirclesEnabled = false
lineDataSet.drawValuesEnabled = false
lineDataSet.drawFilledEnabled = true
lineDataSet.fillColor = UIColor.blue
lineDataSet.fillAlpha = 0.9
let data = LineChartData()
data.addDataSet(lineDataSet)
line.data = data
line.chartDescription?.text = "Monte Carlo Simulation"
line.backgroundColor = UIColor.clear
line.chartDescription?.textColor = UIColor.blue
line.xAxis.labelTextColor = UIColor.blue
line.gridBackgroundColor = NSUIColor.blue
line.animate(xAxisDuration: 1, yAxisDuration: 1)
}
While this is the expected output (showed once in many runs)