最佳答案
首先通过这样做使其填充线后面的颜色:
dataset.setDrawFilled(true);
之后,你必须为你在 drawables 中制作一个类似 gradient_chart_color 的 xml 文件提供渐变:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="90"
android:startColor="#FFF300"
android:endColor="#F5F094" />
</shape>
之后你必须这样做:
Drawable drawable = ContextCompat.getDrawable(this, R.drawable.fade_red);
dataset.setFillDrawable(drawable);
关于android - 具有以下样式的 MPAndroidoid 图表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47052515/