本文整理汇总了Java中lecho.lib.hellocharts.model.Line.setValues方法的典型用法代码示例。如果您正苦于以下问题:Java Line.setValues方法的具体用法?Java Line.setValues怎么用?Java Line.setValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lecho.lib.hellocharts.model.Line
的用法示例。
在下文中一共展示了Line.setValues方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: autoSplitLine
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
private ArrayList<Line> autoSplitLine(Line macroline, final float jumpthresh) {
ArrayList<Line> linearray = new ArrayList<>();
float lastx = -999999;
List<PointValue> macropoints = macroline.getValues();
List<PointValue> thesepoints = new ArrayList<>();
if (macropoints.size() > 0) {
final float endmarker = macropoints.get(macropoints.size() - 1).getX();
for (PointValue thispoint : macropoints) {
// a jump too far for a line? make it a new one
if (((lastx != -999999) && (Math.abs(thispoint.getX() - lastx) > jumpthresh))
|| thispoint.getX() == endmarker) {
if (thispoint.getX() == endmarker) {
thesepoints.add(thispoint);
}
Line line = (Line) cloneObject(macroline); // aieeee
try {
line.setValues(thesepoints);
linearray.add(line);
} catch (NullPointerException e) {
//
}
thesepoints = new ArrayList<PointValue>();
}
lastx = thispoint.getX();
thesepoints.add(thispoint); // grow current line list
}
}
return linearray;
}
示例2: autoSplitLine
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public ArrayList<Line> autoSplitLine(Line macroline, final float jumpthresh) {
// if (d) Log.d(TAG, "Enter autoSplit Line");
ArrayList<Line> linearray = new ArrayList<Line>();
float lastx = -999999;
List<PointValue> macropoints = macroline.getValues();
List<PointValue> thesepoints = new ArrayList<PointValue>();
if (macropoints.size() > 0) {
final float endmarker = macropoints.get(macropoints.size() - 1).getX();
for (PointValue thispoint : macropoints) {
// a jump too far for a line? make it a new one
if (((lastx != -999999) && (Math.abs(thispoint.getX() - lastx) > jumpthresh))
|| thispoint.getX() == endmarker) {
if (thispoint.getX() == endmarker) {
thesepoints.add(thispoint);
}
Line line = (Line) cloneObject(macroline); // aieeee
line.setValues(thesepoints);
linearray.add(line);
thesepoints = new ArrayList<PointValue>();
}
lastx = thispoint.getX();
thesepoints.add(thispoint); // grow current line list
}
}
// if (d) Log.d(TAG, "Exit autoSplit Line");
return linearray;
}