iOS-Chart:在BarChartView的分组集中增加条宽

时间:2017-03-20 08:51:04

标签: ios swift charts ios-charts

我试图增加chartBarView中的条形宽度。 有我的代码:

let groupSpace = 0.01
let barSpace = 0.01
let barWidth = 0.32
// (0.32 + 0.01) * 3 + 0.01 = 1.00

let groupCount = 9
let startMonth = 0


chartData.barWidth = barWidth;
barChartView.xAxis.axisMinimum = Double(startMonth)
let spaceIndividualBar = chartData.groupWidth(groupSpace: groupSpace, barSpace: barSpace)
print("spaceIndividualBar must be equan to 1 : \(spaceIndividualBar)")
barChartView.xAxis.axisMaximum = Double(startMonth) + spaceIndividualBar * Double(groupCount)

chartData.groupBars(fromX: Double(startMonth), groupSpace: groupSpace, barSpace: barSpace) 

我希望将单个条的宽度加倍,而不是这个结果:

enter image description here

1 个答案:

答案 0 :(得分:0)

减小两个条之间的空间,增加条宽度。