-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
horizontal bar graph value different decimal places each time #1260
Comments
Valueformatter |
I tried with it but it is still showing random decimal places. Here is the code `self.setupBarLineChartView(self.chartView)
` `func setDataCount(currentYear : Double, previousYear : Double) {
` |
use maximumFractionDigits = 1 |
I tried maximum fraction digit to 1 but it is still not happening. I don't know what happen ? |
where do you set it? |
I mean I put it in my code and run it but it is still not doing it. I set it right after rightAxis.rightAxisMinVal = 0.0. I set it maximum fraction digit to 1 but still not doing it. I don't know if I miss anything in the code. |
it should be used in your data set's value formatter. |
also, are you saying two digits after decimal? Not quite clear what are you asking, so I took a guess you want to show only one digit. Like 5.00 -> 5.0 |
Yes I want to display 5.0. But it is displaying 5.234, 5.23, 5.2 etc. |
then use maximumFractionDigits = 1. |
Thanks for look into it but I am 100% sure it is not happening with my Swift code. Below is the view controller code, if you can please take a look what am i doing wrong ? `import UIKit
} |
Oops never mind. I just resolved the issue. It is issue with my code.
|
Hi There
I am always seeing different decimal places on the bar. I want to stick with 1 decimal only. Can someone please help with it ?
var yVals = [ChartDataEntry]() yVals.append(BarChartDataEntry(value: previousYear, xIndex: 0)) yVals.append(BarChartDataEntry(value: currentYear, xIndex: 1))
Thanks
Hiral
The text was updated successfully, but these errors were encountered: