Graphiew中的ArrayList [英] ArrayList in Graphiew

查看:101
本文介绍了Graphiew中的ArrayList的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个双精度ArrayList(ArrayList),如何将这些arrayLists传递给GraphView以绘制线性图? 对于有限的点,我们可以使用以下代码:

I have two double ArrayList (ArrayList) how can I pass these arrayLists to GraphView to draw my linear chart? for limited points we can use these codes :

GraphView graph = (GraphView) findViewById(R.id.graph);
LineGraphSeries<DataPoint> series = new LineGraphSeries<DataPoint>(new   DataPoint[] {
      new DataPoint(0, 1),
      new DataPoint(1, 5),
      new DataPoint(2, 3),
      new DataPoint(3, 2),
      new DataPoint(4, 6)
});

但是我的ArrayList有数千个点!

but my ArrayLists have thousands points!

推荐答案

如果要用1000点填充LineGraphSeries,则应考虑定义一个列表,并在构造该对象的对象时将其传递给它. LineGraphSeries

If you want to populate the LineGraphSeries with 1000 point then you should consider to define a list and pass this when you construct the object of the LineGraphSeries class

List<DataPoint> myPointList = ....
LineGraphSeries<DataPoint> series = new LineGraphSeries<DataPoint>(Arrays.asList(myPointList));
....

这篇关于Graphiew中的ArrayList的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆