问题描述
我写了一个简单的应用程序的小工具,试图显示的时间图表的使用achartengine库中的迷你图。我的渲染器:
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.
我想知道是否有使用绘图我的迷你图,以便它占据了位图的整个宽度的achartengine一个更好的办法。
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.
推荐答案
您可以以隐藏多余的东西,你可能并不需要使用multipleRenderer.setMargins()和multipleRenderer.setShowLegend()。
You can use multipleRenderer.setMargins() and multipleRenderer.setShowLegend() in order to hide the extra stuff you may not need.
问候,
丹
这篇关于我该如何绘制achartengine一个迷你图没有边界?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!