问题
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