I am unable to draw negative y values ββand positive y values ββin the same barcher using MPAndroidChart
Please help .. as I wrote in the title of the question, I cannot draw negative y values ββand positive y values ββin the same velvet. I am using your code and only changing a few lines.
original source: https://raw.githubusercontent.com/PhilJay/MPAndroidChart/master/MPChartExample/src/com/xxmassdeveloper/mpchartexample/BarChartActivity.java .
edited source: https://db.tt/FWGvAZOZ
I only edited line 266-273.
Excerpt (original):
for (int i = 0; i < count; i++) {
float mult = (range + 1);
float val = (float) (Math.random() * mult);
yVals1.add(new BarEntry(val, i));
}
Edited snippet:
for (int i = 0; i < count; i++) {
float val = (float) ((double)1.0 * (float)i) -5;
yVals1.add(new BarEntry(val, i));
}
I am already opening an issue in the author of github (issue # 183) and I am posting it here on stackoverflow hoping I have a faster answer here.
Thanks guys
+3
source to share