iOS-图表 : Increasing bar width in grouped sets of BarChartView

标签 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

最佳答案

减少两个栏之间的间距,增加栏的宽度。

关于iOS-图表 : Increasing bar width in grouped sets of BarChartView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42899203/

相关文章:

swift - 出现任何 "fatal error: unexpectedly found nil while unwrapping an Optional value"时中断

javascript - Google 图表生成 1px 分隔符

c# - 如何更改图表列 C# 中的图例文本?

ios - iosopendev-找不到首选项框架文件错误

ios - UIAlertController 中 UITextField 之间的距离

ios - 选项卡栏,点击 Root View Controller

ios - 更新自动布局约束以重新定位文本字段

iphone - 如何在不使用应用内购买的情况下在 iOS 应用内销售产品

ios - Xcode 11 中的 iOS 构建失败

gwt - 谷歌财经风格的时间序列图