yuxinburen / achartengine

Automatically exported from code.google.com/p/achartengine
0 stars 0 forks source link

Chart drawing in the margin when background is set to transparent. #270

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I use the setXAxisMin, setXAxisMax, setYAxisMin and setYAxisMax to let only 
a portion of the data shown. 
2. I want to have the chart blend with the background nicely, so I set the 
margin background transparent
3.

What is the expected output? What do you see instead?
Now the data is drawn off the chart, see the image of a transparent and solid 
color background chart comparison. The lines are drawing to the left and below 
the bottom of the chart.

Please provide a source code snippet that we can use to replicate the issue.

// Switching the following line can see the difference.

//      mChart.setBackgroundColor(Color.TRANSPARENT);
//      mRenderer.setMarginsColor(Color.TRANSPARENT);

        mChart.setBackgroundColor(context.getResources().getColor(android.R.color.background_light));
        mRenderer.setMarginsColor(context.getResources().getColor(android.R.color.background_light));

What version of the product binary library are you using?
1.0

Original issue reported on code.google.com by yxcc...@gmail.com on 4 Feb 2013 at 6:36

Attachments:

GoogleCodeExporter commented 9 years ago
Don't use transparent background on the margins.

Original comment by dandrome...@gmail.com on 6 Feb 2013 at 9:04

GoogleCodeExporter commented 9 years ago
I have some gradient in the background below the chart, that starts before and 
ends after the chart, so I can't use the same gradient as a chart background.

And I can't find any better solution, rather than to use the transparent margin 
color.

Original comment by oleg.skr...@gmail.com on 5 Feb 2015 at 5:07