tags:

views:

38

answers:

0

I have written a simple app widget that tries to display a time chart as a sparkline using the achartengine library. My renderer is:

final XYMultipleSeriesRenderer multipleRenderer = new XYMultipleSeriesRenderer();
final XYSeriesRenderer renderer = new XYSeriesRenderer();
multipleRenderer.addSeriesRenderer(renderer);
multipleRenderer.setShowAxes(false);
multipleRenderer.setShowLabels(false);
multipleRenderer.setShowLegend(false);
multipleRenderer.setShowGrid(false);

and after creating a dataset I draw to a bitmap using:

final TimeChart tc = new TimeChart(dataset, multipleRenderer);
final Bitmap image1 = Bitmap.createBitmap(INITIAL_WIDTH, INITIAL_HEIGHT, Bitmap.Config.ARGB_8888);
final Canvas canvas = new Canvas(image1);
tc.draw(canvas, 0, 0, INITIAL_WIDTH, INITIAL_HEIGHT);

but annoyingly the chart I get has a thick border where the axes and labels would have been.

I would like to know if there is a better way using achartengine of plotting my sparkline so that it occupies the whole width of the bitmap.