使用 GraphView 库我发现了这部分代码:
/*
* use Date as x axis label
*/
long now = new Date().getTime();
data = new GraphViewData[size];
for (int i=0; i<size; i++) {
data[i] = new GraphViewData(now+(i*60*60*24*1000), rand.nextInt(20)); // next day
}
exampleSeries = new GraphViewSeries(data);
if (getIntent().getStringExtra("type").equals("bar")) {
graphView = new BarGraphView(
this
, "GraphViewDemo"
);
} else {
graphView = new LineGraphView(
this
, "GraphViewDemo"
);
((LineGraphView) graphView).setDrawBackground(true);
}
graphView.addSeries(exampleSeries); // data
显示日期如“9 月 16 日,9 月 20 日”等...是否可以更改此代码并每小时显示小时数?像“06.00、07.00、08.00”等?