title: Drawing bar graphs with AChartEngine Android
body: <pre><code>import org.achartengine.ChartFactory;
  import org.achartengine.chart.BarChart.Type;
  import org.achartengine.model.CategorySeries;
  import org.achartengine.model.XYMultipleSeriesDataset;
  import org.achartengine.renderer.XYMultipleSeriesRenderer;
  import org.achartengine.renderer.XYSeriesRenderer;
  
  import android.content.Context;
  import android.content.Intent;
  import android.graphics.Color;
  
  public class BarGraph {
  public Intent getIntent(Context context) {
      int[] y = { 111, 201, 9, 876, 123 };
  
      CategorySeries series = new CategorySeries("Survey Result Graphs");
  
      for(int i = 0; i &lt; y.length; i++) {
          series.add("Bar " + (i+1), y[i]);
      }
  
      XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
      dataset.addSeries(series.toXYSeries());
  
      XYSeriesRenderer renderer = new XYSeriesRenderer();
      renderer.setDisplayChartValues(true);
      renderer.setChartValuesSpacing((float) 0.5);
      renderer.setColor(Color.LTGRAY);
  
      XYMultipleSeriesRenderer mRenderer = new XYMultipleSeriesRenderer();
      mRenderer.addSeriesRenderer(renderer);
      mRenderer.setChartTitle("Survey Results");
      mRenderer.setXTitle("X Values");
      mRenderer.setYTitle("Y Values");
  
      Intent intent = ChartFactory.getBarChartIntent(context, dataset, mRenderer, Type.DEFAULT);
  
      return intent;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I am using the above code to draw a bar graph and testing it on my phone. This has been completely picked up from a video tutorial. However, whenever this activity is called upon a click event (in another activity), a blank white screen and absolutely no graph shows up. Please help. Thanks! </p>