在我看来,这似乎是一件非常微不足道的事情,我在Android上工作但不在iOS上工作,即使在以前的问题和以前的问题上阅读相当彻底... ...
无论如何,我只是想创建一个历史价格数据的组合图表,其中包括烛台图表和背景中的音量指示器(条形图)。它显示如下:
代码非常简单,并遵循以下示例:
columns = ['one','two','three','four']
df = pd.DataFrame(sna,columns=columns)
kar = []
[[kar.append(h) for m,h in g.groupby(g['four'] -
np.arange(g.shape[0])) if len(h) > 1] for k,g in
df.groupby(df['three'])]
当我删除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()
时,它会显示烛台正常,但我无法获得"缩放"依赖于烛台值(远低于音量条)。
有什么想法吗?
谢谢!
答案 0 :(得分:0)
看起来像干净+重建为我工作, doh