How to make a grouped BarChart with ios-charts?

后端 未结 5 1896
不思量自难忘°
不思量自难忘° 2020-12-16 03:59

I am using ios-charts library.

I would like to group my inverter values so that each year is one group. Unfortunately, the number of monthly values per year may vary

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-16 04:33

    I've tried Rajan Twanabashu solution, but it was almost the good one. Maybe it has changed since, I don't know.

    Here's what I've done, after I found the groupWidth function in the BarDataChart file from Charts.

    groupWidth function declaration

    let groupSpace = 1 - n * (barWidth + barSpace)

    Hope it could help

提交回复
热议问题