MPAndroidChart 如何更改超过限制线的条形图的颜色?
MPAndroidChart how to change the color of the bar chart past the limit line?
如何改变超出限制线的条形图的颜色?
现在,越过限制线的条会改变颜色。
但是,我想改变越过限制线的部分的颜色。
我想你可以用 stackedBarChart
来实现。
在 docs 中,您可以看到如何为每个柱添加数据。
这样,您将按如下方式设置条形图的数据:
BarEntry(xPosition, floatArray(belowLineNumber, aboverLineNumber)
对于颜色,您只需要为数据集添加一个颜色列表(在您的特定情况下是两种颜色):
dataSet.color = listOf(YourColor1, YourColor2)
希望对您有所帮助!
如何改变超出限制线的条形图的颜色?
现在,越过限制线的条会改变颜色。
但是,我想改变越过限制线的部分的颜色。
我想你可以用 stackedBarChart
来实现。
在 docs 中,您可以看到如何为每个柱添加数据。 这样,您将按如下方式设置条形图的数据:
BarEntry(xPosition, floatArray(belowLineNumber, aboverLineNumber)
对于颜色,您只需要为数据集添加一个颜色列表(在您的特定情况下是两种颜色):
dataSet.color = listOf(YourColor1, YourColor2)
希望对您有所帮助!