How to make a grouped BarChart with ios-charts?

后端 未结 5 1883
不思量自难忘°
不思量自难忘° 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:25

    if you have noticed in above code in function chart. There is let

     groupSpace = 0.3
     let barSpace = 0.05
     let barWidth = 0.3
     // (0.3 + 0.05) * 2 + 0.3 = 1.00 -> interval per "group" 
    

    which will make equation (groupSpace * barSpace) * n + groupSpace = 1

    you need to play around this equation for n number of bars

提交回复
热议问题