MPAndroidChart how to change the color of the bar chart past the limit line?

时光毁灭记忆、已成空白 提交于 2020-01-26 03:55:07

问题


How to change the color of the bar chart past the limit line? Now, bars that cross the limit line change color. But, I want to change the color of the part cross the limit line.


回答1:


I think you can achieve that with stackedBarChart.

Here in the docs you can see how to add the data for each bar. With this, you will set the data for a barchart as follows:

BarEntry(xPosition, floatArray(belowLineNumber, aboverLineNumber)

For the colors, you just need to add a list of colors fot the data set(two colors in your specific case):

dataSet.color = listOf(YourColor1, YourColor2)

Hope it helps!



来源:https://stackoverflow.com/questions/59744829/mpandroidchart-how-to-change-the-color-of-the-bar-chart-past-the-limit-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!