MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

BarChart:How do you make the X-axis display a fixed number, and then scroll if you exceed that number?

Open Deaful opened this issue 3 years ago • 2 comments

BarChart In addition, how to modify the text spacing on the bar chart? Can I set rounded corners for bar graphs? Thank you for your answer

Deaful avatar Oct 19 '22 10:10 Deaful

柱状图圆角可以看下我的这篇分享:https://juejin.cn/post/7100863388850503693

gs666 avatar Oct 21 '22 02:10 gs666

Screen Shot 2565-11-24 at 01 01 03 @gs666 how can I draw round bottom bar. I changed code as below

roundRect(new RectF(buffer.buffer[j], buffer.buffer[j + 1], buffer.buffer[j + 2], buffer.buffer[j + 3]), mRadius, mRadius, true, true, true, true) I got top round bar but cut on the bottom when every data entry has value

Here is example when every entry has value > 0 val values = ArrayList<BarEntry>() for (i in 1..max) { values.add(BarEntry(i.toFloat(), 2f)) }

And here when some value are zero, I got rounded bar properly for (i in 1..max) { if (i == 10){ values.add(BarEntry(i.toFloat(), 0f)) }else{ values.add(BarEntry(i.toFloat(), 2f)) } }

Screen Shot 2565-11-24 at 01 10 12

siwarakDee avatar Nov 23 '22 18:11 siwarakDee