简体   繁体   中英

X-axis values on grouped bar chart

I have created group bar using iOS Charts library but unable to set X-axis values properly in swift3. So please help.

I add data like this

for i in 0 < data.count {
    let dataEntryForHours1 = BarChartDataEntry(x: Double(i), y: Double(value))
    let dataEntryForHours2 = BarChartDataEntry(x: Double(i), y: Double(value))
}

but still getting random double values on X-Axis like -0.5,0.3, 0.6 and so on.

You need to assign an interval from 0 to data.count.

for i in 0..<data.count {
   // ...
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM