I’m using the chart framework achartengine to create a simple horizontal bar chart, however whenever I switch it to landscape it smashes the label text making it almost unreadable. This is how I initialize the chart:
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);
This is how it looks portrait: http://www.flickr.com/photos/84608958@N02/7748322920/
And this is it all smashed in landscape: http://www.flickr.com/photos/84608958@N02/7748322690/
Any help/suggestions would be much appreciated, thank you for your time!
NOTE: I have tried resizing the text and the smash effect still persists
Horizontal bar charts were developed only as some prototype in AChartEngine. In the end it was included in the distribution because many users need it. However, one day it will be improved as there are a lot of issues with it. See issue #203.