我正在使用令人惊叹的库MPAndroidChart。它的表现十分出色,但是当我尝试更改BarData的背景颜色时遇到了问题。默认颜色是白色,而我想要将其改为透明。
我已经尝试过以下方法:
Paint p1 = mChart.getPaint(Chart.PAINT_GRID_BACKGROUND);
p1.setColor(Color.RED);
以及这个:
<com.github.mikephil.charting.charts.BarChart
android:id="@+id/chart1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"/>
...但似乎不起作用。
有什么想法吗?
谢谢=)