如何在android中的graphview上显示两个折线图从数据库中获取值?
这是我的代码
gvp1=new GraphViewData[systolic.size()];
for(int i=0;i<gvp1.length;i++)
{
gvp1[i]=new GraphViewData(Double.parseDouble(systolic.get(i).toString()), Double.parseDouble(diastolic.get(i).toString()));
System.out.println("array avp1 is......."+Double.parseDouble(systolic.get(i).toString()));
}
LineGraphView graphView = new LineGraphView(
this
, "BP Graph"
);
graphView.addSeries(new GraphViewSeries(gvp1));
System.out.println("in graphview......"+gvp1);
/*
graphView.addSeries(new GraphViewSeries(new GraphViewData[] {
new GraphViewData(1, 2.0d)
}));*/
/*
ViewHolder v = null;
v = new ViewHolder();
convertView=null;
*/
setContentView(graphView);
// setContentView(R.layout.demo11);
ImageView iv = new ImageView(this);
iv.setImageResource(R.drawable.graph_header);
graphView.addView(iv);
}
这就是我从数据库获取值到图形的方式。但我希望以相同的比例绘制另一个折线图。任何工作代码都会有很大帮助..