gpt4 book ai didi

ios - 烛台 + 柱形图的组合图

转载 作者:行者123 更新时间:2023-11-30 11:46:36 29 4
gpt4 key购买 nike

在我看来,这似乎是一件非常微不足道的事情,我让它在 Android 上运行,但在 iOS 上不起作用,即使在彻底阅读了之前的问题之后也是如此......

无论如何,我只是想创建一个历史价格数据的组合图表,其中包括蜡烛图以及后台的成交量指标(条形图)。它显示如下:

enter image description here

代码非常简单并且遵循示例:

let set1 = CandleChartDataSet(values: yVals1, label: "Data Set")
set1.axisDependency = YAxis.AxisDependency.left
set1.setColor(UIColor(white: 80 / 255, alpha: 1))
set1.drawIconsEnabled = false
set1.shadowColor = .darkGray
set1.shadowWidth = 0.7
set1.decreasingColor = .red
set1.decreasingFilled = true
set1.increasingColor = UIColor(red: 122 / 255, green: 242 / 255, blue: 84 / 255, alpha: 1)
set1.increasingFilled = false
set1.neutralColor = .blue
set1.drawValuesEnabled = false
self.candleStickChartView.xAxis.valueFormatter = IndexAxisValueFormatter(values: xValues)
let candleStickData = CandleChartData(dataSet: set1)


let data = CombinedChartData()
let barChartDataSet = BarChartDataSet(values: barChartEntries, label: "values")
barChartDataSet.setColor(UIColor.rhLightGrey().withAlphaComponent(0.3))
barChartDataSet.axisDependency = YAxis.AxisDependency.right
let barChartData = BarChartData(dataSet: barChartDataSet)

data.candleData = candleStickData
data.barData = barChartData

self.candleStickChartView.rightAxis.axisMinimum = 0.0

self.candleStickChartView.data = data
self.candleStickChartView.setNeedsDisplay()

当我删除 data.barData = barChartData 时,它会很好地显示烛台,但是我无法让“缩放”取决于烛台值(远低于交易量)酒吧。

有什么想法吗?

谢谢!

最佳答案

看起来干净+重新构建对我有用,doh

关于ios - 烛台 + 柱形图的组合图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48757309/

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