MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

BarChart如何设置每个柱状图的宽度

Open SaiKeiSi opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

ADD A REWARD using Speed to SOLVE this issue QUICKLY and SUPPORT this project.

SaiKeiSi avatar Jul 12 '24 03:07 SaiKeiSi

相信有遇到和我一样的问题 添加每个柱状图后 宽度会随着减少 设置的宽度并不可用 可以尝试如下解决 原: barWidth = 0.3f 现在: barWidth = if (loadList.size<7) loadList.size * 0.055f else 0.3f

原理 Barchart总宽度为1 设置没个后 总占比0.3 然后 就需要你就算出每个的宽度if (list.size<7) list.size * 0.055f else 0.3f

SaiKeiSi avatar Jul 12 '24 03:07 SaiKeiSi