0

I would like to set the background black square to transparent but the result is like this.

_renderer.setApplyBackgroundColor(true);
_renderer.setBackgroundColor(Color.TRANSPARENT);
_renderer.setMargins(new int[]{0,0,0,0});
_renderer.setMarginsColor(Color.TRANSPARENT);

I want to set the graph part a little smaller to have the axis text some space. I don't want the black things... how to set it to be transparent.

Anther question, how to use the xml to set the view. I am now using an linear layout in the xml, and then use linearlayer.addView(view) to add the view that returned by the achartengine: ChartFactory.getBarChartView(...) but if I define a view in the xml, how to directly set the view's content the bar content. I mean not using the dynamic addView in my code, but set the view using xml. Thanks.

my activity view

stcheng
  • 133
  • 5
  • 17

2 Answers2

4

-> I am not sure if you looked at AChartEngine transparent background question. It talks about similar issue:

According to it, You can try:

setMarginsColor(Color.argb(0x00, 0x01, 0x01, 0x01));

-> If it does not work you may try to create the activity with transparent background and may also give it a dialog look if you want:

Android: how to create a transparent dialog-themed activity

How do I create a transparent Activity on Android?

Hope this helps.

Community
  • 1
  • 1
Shobhit Puri
  • 25,769
  • 11
  • 95
  • 124
0

If you want to set transparent background color, you can try:

renderer.setMarginsColor(Color.argb(0x00, 0xff, 0x00, 0x00));

It just be work for me!