2014-01-19 1 views

답변

0

ur 활동 중 oncreate()에서 이것을 사용하십시오.

setContentView(R.layout.main); 
    XYPlot plot = (XYPlot) findViewById(R.id.mySimpleXYPlot); 

    Number[] series1Numeros = { 1, 8, 5, 2, 7, 4 }; 
    XYSeries series1 = new SimpleXYSeries(Arrays.asList(series1Numeros), 
      SimpleXYSeries.ArrayFormat.Y_VALS_ONLY, "Intereses"); 

    XYSeries series = new SimpleXYSeries(Arrays.asList(new Number[] { 1, 2, 3, 4, 5 }), 
      SimpleXYSeries.ArrayFormat.Y_VALS_ONLY, "title"); 
    BarFormatter formatter = new BarFormatter(Color.rgb(0, 200, 0), Color.rgb(100, 0, 0)); 
    plot.addSeries(series, BarRenderer.class, formatter); 
    BarRenderer renderer = (BarRenderer) plot.getRenderer(BarRenderer.class); 
    LineAndPointFormatter series1Format = new LineAndPointFormatter(Color.rgb(0, 200, 0), 
      Color.rgb(0, 100, 0), 
      null); 

    plot.addSeries(series1, series1Format);