如何在两个折线图之间进行组合

时间:2014-11-18 09:49:10

标签: java android achartengine

我想添加另一个时间序列到日期设置出现两个单独的折线图但我得到错误数据集和渲染应该不是null并且应该是相同数量的系列 请帮帮我

        int[] visits = { 100, 200,500};
    int[] visits2 = { 300, 400,500};

     int count=2;

    ///Date[] dt = new Date[10];

       TimeSeries visitsSeries = new TimeSeries("Visits");      
       TimeSeries visitsSeries2 = new TimeSeries("Visits2");        


        for(int i=0;i<j;i++){
            D=datesD[i];
            M=datesM[i]-1;
            Y=datesy[i];
    GregorianCalendar gc = new GregorianCalendar(2014,11, 11+i);
            if(gc.getTime()!=null )
           visitsSeries.add(gc.getTime(), visits2[i] );
            visitsSeries2.add(gc.getTime(), visits[i]);
        }

        XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();

        // Adding Visits Series to the dataset
        dataset.addSeries(visitsSeries);
    dataset.addSeries(visitsSeries2);  // here problem when delete is fine but i wanna 
      //two TimeSeries

0 个答案:

没有答案