I want to display graph using Achartengine in Fragment. 
In my layout file I have used empty linear layout to add graph returned by createIntent() method 
but it only shows blank screen 
I am using following code 

My Fragment activity is as below

pls help 

```
public class Analytics_Screen extends Fragment implements OnClickListener,SlideActivity.Callbacks{

View checkanalytics_view;
SlideActivity activity;

LinearLayout graph_container; 

@Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        activity = (SlideActivity) getActivity();
        metrics = new DisplayMetrics();
        activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
    }

@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState)
    {
        if (checkanalytics_view == null)
        {
            checkanalytics_view = inflater.inflate(R.layout.checkanalytics_screen, null, false);
        }

        activity.OpenLeftmenu(0);
        SlideActivity.registerCallback(this);

        graph_container     = (LinearLayout)checkanalytics_view.findViewById(R.id.graph_container);

        final GraphicalView gv =createIntent();         
        graph_container.addView(gv,new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT));
        return checkanalytics_view;

    }

  public GraphicalView createIntent() 
    {

     //   List<double[]> values = new ArrayList<double[]>();

        System.out.println("==============create Intent Start==========================");
        List<Double> dValues=new ArrayList<Double>();
        dValues.add((double) 5000);
        dValues.add((double) 6000);
        dValues.add((double) 7000);
        dValues.add((double) 8000);
        dValues.add((double) 10000);
        dValues.add((double) 5000);
        dValues.add((double) 25000);
        dValues.add((double) 50000);
        dValues.add((double) 50000);
       // values.add(new double[] { 5000, 7300, 9240,10230, 11300, 10040,14230, 12300, 14240});

        int[] colors = new int[] { Color.parseColor("#77c4d3")};
        XYMultipleSeriesRenderer renderer = buildBarRenderer(colors);
        renderer.setOrientation(Orientation.VERTICAL);
        setChartSettings(renderer, "Analitics", "", "",0.1,
            12.5, 0,50000, Color.BLACK, Color.BLACK);
       renderer.setXLabels(1);
        renderer.setYLabels(10);
        renderer.addXTextLabel(1, "Male");
        renderer.addXTextLabel(2, "Female");
        renderer.addXTextLabel(3, "Age 0-20");
        renderer.addXTextLabel(4, "Age 21-30");
        renderer.addXTextLabel(5, "Age 31-40");
        renderer.addXTextLabel(6, "Age 41-50");
        renderer.addXTextLabel(7, "Age 50+");
        renderer.addXTextLabel(8, "Penciled");
        renderer.addXTextLabel(9, "Attended");
     /*   renderer.addXTextLabel(10, "Oct");
        renderer.addXTextLabel(11, "Nov");
        renderer.addXTextLabel(12, "Dec");*/

        int length = renderer.getSeriesRendererCount();
        for (int i = 0; i < length; i++) {
          SimpleSeriesRenderer seriesRenderer = renderer.getSeriesRendererAt(i);
          seriesRenderer.setDisplayChartValues(true);
        }

        final GraphicalView grfv = ChartFactory.getBarChartView(activity, buildBarDataset(dValues), renderer,Type.DEFAULT);

        System.out.println("===============Graph View=================="+grfv);
        return grfv;
      }

    protected XYMultipleSeriesRenderer buildBarRenderer(int[] colors) {
        XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
        renderer.setAxisTitleTextSize(10);
        renderer.setChartTitleTextSize(20);
        renderer.setLabelsTextSize(10);
        renderer.setLegendTextSize(5);
        renderer.setBarSpacing(1);
        renderer.setMarginsColor(Color.parseColor("#EEEDED"));
        renderer.setXLabelsColor(Color.BLACK);
        renderer.setYLabelsColor(0,Color.BLACK);

        renderer.setApplyBackgroundColor(true);
        renderer.setBackgroundColor(Color.parseColor("#FBFBFC"));
        renderer.setInScroll(true);

        int length = colors.length;
        Log.d("Color Len",""+length);
        for (int i = 0; i < length; i++) {
          SimpleSeriesRenderer r = new SimpleSeriesRenderer();
          r.setColor(colors[i]);
         // r.setChartvalueAngle(-90);

          r.setChartValuesSpacing(25);
          renderer.addSeriesRenderer(r);
        }
        return renderer;
      }

  protected XYMultipleSeriesDataset buildBarDataset(List<Double> values) {
        XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();

          CategorySeries series = new CategorySeries("Amount");
         // Double v = values.get(0);
          int seriesLength = values.size();
          for (int k = 0; k < seriesLength; k++) {
            series.add(values.get(k));
          }
          dataset.addSeries(series.toXYSeries());

        return dataset;
      }

  protected void setChartSettings(XYMultipleSeriesRenderer renderer, String title, String xTitle,
          String yTitle, double xMin, double xMax, double yMin, double yMax, int axesColor,
          int labelsColor) {
        renderer.setChartTitle(title);
        renderer.setYLabelsAlign(Align.RIGHT);
        renderer.setXLabelsAlign(Align.RIGHT);
        renderer.setXTitle(xTitle);
        renderer.setYTitle(yTitle);
        renderer.setXAxisMin(xMin);
        renderer.setXAxisMax(xMax);
        renderer.setYAxisMin(yMin);
        renderer.setYAxisMax(yMax);
        renderer.setMargins(new int[] {15,50,50,50 });
        renderer.setAxesColor(axesColor);
        renderer.setLabelsColor(labelsColor);
      }

```