我正在使用MPAndroidChart 库v2.0.8。我可以在条形图外部修改背景,但在内部,仍然是灰色背景,我不知道可以使用哪种方法。
barchart = (BarChart) findViewById(R.id.chart);
barchart.setBackgroundColor(getRessouces().getColor(R.color.default_color));
我有这个结果:
我也想在图表中使用默认颜色。
非常感谢,
卡梅尔
我正在使用MPAndroidChart 库v2.0.8。我可以在条形图外部修改背景,但在内部,仍然是灰色背景,我不知道可以使用哪种方法。
barchart = (BarChart) findViewById(R.id.chart);
barchart.setBackgroundColor(getRessouces().getColor(R.color.default_color));
我有这个结果:
我也想在图表中使用默认颜色。
非常感谢,
卡梅尔
看看文档。
您可以使用以下两种方法删除或修改“绘图区域”后面的背景:
setDrawGridBackground(boolean enabled)
:如果启用,将绘制图表绘图区域后面的背景矩形。setGridBackgroundColor(int color)
:设置绘制网格背景的颜色。