Closed GoogleCodeExporter closed 9 years ago
toBitmap() works fine for displaying charts.
It seems like you don't display it, but just want to save an image.
Original comment by dandrome...@gmail.com
on 23 Aug 2011 at 12:18
It's absolutely not working fine. For me and many others. Not sure why this
was closed.
Original comment by chrispar...@gmail.com
on 23 Aug 2011 at 12:42
I have the same problem. toBitmap method returns null for a simple pie graph
int[] colors = new int[]{Color.RED, Color.YELLOW, Color.BLUE};
DefaultRenderer renderer = buildCategoryRenderer(colors);
CategorySeries categorySeries = new CategorySeries("Vehicles Chart");
categorySeries.add("cars ", 30);
categorySeries.add("trucks", 20);
categorySeries.add("bikes ", 60);
GraphicalView pieChartView = ChartFactory.getPieChartView(context,
categorySeries, renderer);
Bitmap b = pieChartView.toBitmap()
Original comment by sebastij...@gmail.com
on 17 Jan 2012 at 12:36
[deleted comment]
Hi.
Maybe try to set size of the Chart View.
chartView.setDrawingCacheEnabled(true);
chartView.measure(MeasureSpec.makeMeasureSpec(0,
MeasureSpec.UNSPECIFIED),MeasureSpec.makeMeasureSpec(0,
MeasureSpec.UNSPECIFIED));
chartView.layout(0,
0,chartView.getMeasuredWidth(),chartView.getMeasuredHeight());
chartView.buildDrawingCache(true);
Bitmap bitmap = Bitmap.createBitmap(chartView.getDrawingCache());
This problem is at MapView in google maps API.
Toni
Original comment by toniabc@gmail.com
on 25 Jan 2012 at 11:57
Some comments from a user related to this issue:
I also had an issue, the background of the chart was white when i exported it
as a bitmap, so i used :
renderer.setBackgroundColor(Color.BLACK);
renderer.setApplyBackgroundColor(true);
To configure the renderer and then:
v.setBackgroundColor(renderer.getBackgroundColor());
Before buidling the drawing cache
And it worked, i just let the code if anyone has this trouble.
Original comment by dandrome...@gmail.com
on 10 May 2012 at 9:22
Original comment by dandrome...@gmail.com
on 11 May 2012 at 6:28
Original issue reported on code.google.com by
chrispar...@gmail.com
on 12 Aug 2011 at 2:09