本文介绍了AChartEngine 透明背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有问题.我正在用 AChartEngine 制作一个图表,我想让整个图表的背景透明:
I have a problem. I'm making a graph with AChartEngine and I would like to have the background of the whole graph to be transparent:
XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
(...)
renderer.setMargins(new int[]{0,0,0,0});
renderer.setApplyBackgroundColor(true);
renderer.setMarginsColor(Color.TRANSPARENT);
renderer.setBackgroundColor(Color.TRANSPARENT);
(...)
GraphicalView g = ChartFactory.getTimeChartView(this, dataset, renderer, "dd/MM");
但它不能正常工作:
如您所见,x 标签后面出现了一个黑框.我做错了什么?
As you can see, there is a black box appearing behind the x-labels. What am I doing wrong?
提前致谢,
黄豆
Thanks in advance,
yellos
推荐答案
试试 setMarginsColor(Color.argb(0x00, 0x01, 0x01, 0x01));将颜色设置为黑色透明时似乎有错误
Try setMarginsColor(Color.argb(0x00, 0x01, 0x01, 0x01)); It looks like there's a bug when setting the color as black transparent
这篇关于AChartEngine 透明背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!