我正在使用图表框架 achartengine 创建一个简单的水平条形图,但是每当我将其切换到横向时,它都会破坏标签文本,使其几乎无法阅读。这就是我初始化图表的方式:
renderer = new XYMultipleSeriesRenderer();
dataset = new XYMultipleSeriesDataset();
seriesRenderer = new XYSeriesRenderer();
series = new CategorySeries("Episodes");
renderer.setOrientation(Orientation.VERTICAL); //display the bars horizontally
//allow the chart to scroll up and down, but not left to right
renderer.setPanEnabled(true, false);
renderer.setZoomEnabled(true,false);
renderer.setXLabelsAlign(Align.LEFT);
renderer.setLabelsTextSize(20);
renderer.setXLabels(0);
renderer.setBarSpacing(.25);
int[] margins = new int[]{0,0,20,20};
renderer.setMargins(margins);
renderer.setYTitle("Engagements");
renderer.setXAxisMin(0);
renderer.setXAxisMax(5);
renderer.setYAxisMin(0);
renderer.setShowLegend(false);
renderer.setLegendHeight(0);
renderer.setXLabelsColor(Color.rgb(10,94,143));
renderer.setYLabelsColor(0, Color.DKGRAY);
//cause the margins to be clear
renderer.setMarginsColor(Color.WHITE);
//change the series color
seriesRenderer.setColor(Color.rgb(149,209,240));
//add the series renderer to the renderer
renderer.addSeriesRenderer(seriesRenderer);
这是肖像的样子:http: //www.flickr.com/photos/84608958@N02/7748322920/
这就是它在风景中的全部粉碎:http: //www.flickr.com/photos/84608958@N02/7748322690/
任何帮助/建议将不胜感激,感谢您的宝贵时间!
注意:我已经尝试调整文本大小,粉碎效果仍然存在