You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a bar chart in my project in XCode 8.3 and SWIFT 3. I want to display float values upto a max of 2 decimal places and a minimum of 0 decimal places depending upon the value of data passed.
My current code:
To pass data:
var dataEntries: [BarChartDataEntry] = []
for i in 0...weekData.count-1 {
print("\(i) day data \(Double(weekData[i]))") //e.g. weekData = [0.0,12.03,3.0]
var dataEntry = BarChartDataEntry(x: Double(i), y: Double(weekData[i]))
dataEntries.append(dataEntry)
}
let chartDataSet = BarChartDataSet(values: dataEntries, label: nil)
let chartData = BarChartData(dataSet: chartDataSet)
Problem:
My values are not displayed in float rather are rounded off to nearest whole number.
So is there any way to achieve this?
The text was updated successfully, but these errors were encountered:
Hi,
I have a bar chart in my project in XCode 8.3 and SWIFT 3. I want to display float values upto a max of 2 decimal places and a minimum of 0 decimal places depending upon the value of data passed.
My current code:
To pass data:
Problem:
My values are not displayed in float rather are rounded off to nearest whole number.
So is there any way to achieve this?
The text was updated successfully, but these errors were encountered: