Convert bar chart to a grouped bar chart with danielgindi/ios-charts and Swift

后端 未结 3 1551
难免孤独
难免孤独 2020-12-29 13:20

i have created the simple bar chart with the library at https://github.com/danielgindi/ios-charts still can\'t figure out how to make this a grouped bar chart. I\'ve added t

3条回答
  •  伪装坚强ぢ
    2020-12-29 13:36

    You haven't actually done anything with unitsBought.

    For a bar chart you can do two things:

    1. Add another DataSet with your unitsBought
    2. Use the other overload of BarCharDataEntry(values: [Double], xIndex: Int) or BarCharDataEntry(values: [Double], xIndex: Int, label: String) to pass multiple values per entry, which makes it stacked.

提交回复
热议问题