Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
242 views
in Technique[技术] by (71.8m points)

android - AChartEngine transparent background

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");

But it isn't working properly:

enter image description here

As you can see, there is a black box appearing behind the x-labels. What am I doing wrong?

Thanks in advance,
yellos

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try setMarginsColor(Color.argb(0x00, 0x01, 0x01, 0x01)); It looks like there's a bug when setting the color as black transparent


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...