本文整理汇总了Java中lecho.lib.hellocharts.model.Line.setHasPoints方法的典型用法代码示例。如果您正苦于以下问题:Java Line.setHasPoints方法的具体用法?Java Line.setHasPoints怎么用?Java Line.setHasPoints使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lecho.lib.hellocharts.model.Line
的用法示例。
在下文中一共展示了Line.setHasPoints方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateLineData
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
private LineChartData generateLineData() {
List<Line> lines = new ArrayList<Line>();
for (int i = 0; i < numberOfLines; ++i) {
List<PointValue> values = new ArrayList<PointValue>();
for (int j = 0; j < numberOfPoints; ++j) {
values.add(new PointValue(j, randomNumbersTab[i][j]));
}
Line line = new Line(values);
line.setColor(ChartUtils.COLORS[i]);
line.setCubic(isCubic);
line.setHasLabels(hasLabels);
line.setHasLines(hasLines);
line.setHasPoints(hasPoints);
lines.add(line);
}
LineChartData lineChartData = new LineChartData(lines);
return lineChartData;
}
示例2: generatePreviewLineChartData
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
private LineChartData generatePreviewLineChartData() {
int numValues = 50;
List<PointValue> values = new ArrayList<PointValue>();
for (int i = 0; i < numValues; ++i) {
values.add(new PointValue(i, (float) Math.random() * 100f));
}
Line line = new Line(values);
line.setColor(ChartUtils.DEFAULT_DARKEN_COLOR);
line.setHasPoints(false);// too many values so don't draw points.
List<Line> lines = new ArrayList<Line>();
lines.add(line);
LineChartData data = new LineChartData(lines);
data.setAxisXBottom(new Axis());
data.setAxisYLeft(new Axis().setHasLines(true));
return data;
}
示例3: generateDefaultData
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
private void generateDefaultData() {
int numValues = 50;
List<PointValue> values = new ArrayList<PointValue>();
for (int i = 0; i < numValues; ++i) {
values.add(new PointValue(i, (float) Math.random() * 100f));
}
Line line = new Line(values);
line.setColor(ChartUtils.COLOR_GREEN);
line.setHasPoints(false);// too many values so don't draw points.
List<Line> lines = new ArrayList<Line>();
lines.add(line);
data = new LineChartData(lines);
data.setAxisXBottom(new Axis());
data.setAxisYLeft(new Axis().setHasLines(true));
// prepare preview data, is better to use separate deep copy for preview chart.
// Set color to grey to make preview area more visible.
previewData = new LineChartData(data);
previewData.getLines().get(0).setColor(ChartUtils.DEFAULT_DARKEN_COLOR);
}
示例4: getLines
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
private List<Line> getLines() {
Line line = new Line(this.mPointValues);
line.setColor(this.resources.getColor(R.color.js));
line.setLabelColor(this.resources.getColor(R.color.js));
line.setFilled(true);
line.setCubic(false);
line.setHasLabels(true);
if (this.mWeightRecords == null || this.mWeightRecords.size() == 0 || this.mTypeMode > 0) {
line.setHasPoints(false);
} else {
line.setHasPoints(true);
}
line.setFormatter(new SimpleLineChartValueFormatter().setDecimalDigitsNumber(1));
List<Line> lines = new ArrayList();
Line target = getTargetLine();
if (target != null) {
lines.add(target);
}
lines.add(line);
return lines;
}
示例5: getTargetLine
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
private Line getTargetLine() {
if (!needDrawTargetLine()) {
return null;
}
PointValue lastRecordPoint = (PointValue) this.mPointValues.get(this.mPointValues.size()
- 1);
PointValue targetPoint = new PointValue(((AxisValue) this.mAxisValues.get(this
.mAxisValues.size() - 1)).getValue(), this.mTargetWeight);
List<PointValue> points = new ArrayList();
points.add(lastRecordPoint);
points.add(targetPoint);
Line line = new Line(points);
line.setColor(this.resources.getColor(R.color.da));
line.setPathEffect(new DashPathEffect(new float[]{15.0f, 15.0f, 15.0f, 15.0f}, 0.0f));
line.setHasLabels(false);
if (this.mTypeMode > 0) {
line.setHasPoints(false);
return line;
}
line.setHasPoints(true);
return line;
}
示例6: getLines
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
private List<Line> getLines() {
Line line = new Line(this.mPointValues);
line.setColor(this.resources.getColor(R.color.js));
line.setLabelColor(this.resources.getColor(R.color.js));
line.setFilled(true);
line.setCubic(false);
line.setHasLabels(true);
if (this.mWeightRecords == null || this.mWeightRecords.size() == 0 || this.mTypeMode > 0) {
line.setHasPoints(false);
} else {
line.setHasPoints(true);
}
line.setFormatter(new SimpleLineChartValueFormatter().setDecimalDigitsNumber(1));
List<Line> lines = new ArrayList();
lines.add(line);
return lines;
}
示例7: tempValuesLine
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public Line tempValuesLine(TempWatchData twd, float offset, double factor, boolean isHighlightLine, int strokeWidth) {
List<PointValue> lineValues = new ArrayList<PointValue>();
long begin = (long) Math.max(start_time, twd.startTime);
lineValues.add(new PointValue(fuzz(begin), offset + (float) (factor * twd.startBasal)));
lineValues.add(new PointValue(fuzz(begin), offset + (float) (factor * twd.amount)));
lineValues.add(new PointValue(fuzz(twd.endTime), offset + (float) (factor * twd.amount)));
lineValues.add(new PointValue(fuzz(twd.endTime), offset + (float) (factor * twd.endBasal)));
Line valueLine = new Line(lineValues);
valueLine.setHasPoints(false);
if (isHighlightLine){
valueLine.setColor(basalCenterColor);
valueLine.setStrokeWidth(1);
}else {
valueLine.setColor(basalBackgroundColor);
valueLine.setStrokeWidth(strokeWidth);
}
return valueLine;
}
示例8: extraLines
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public List<Line> extraLines()
{
final List<Line> lines = new ArrayList<>();
Line bloodtest = new Line(bloodTestValues);
bloodtest.setHasLines(false);
bloodtest.setPointRadius(pointSize * 5 / 3);//3 / 2
bloodtest.setHasPoints(true);
bloodtest.setColor(highColor);//ChartUtils.darkenColor(getCol(X.color_calibration_dot_background))
bloodtest.setShape(ValueShape.SQUARE);
lines.add(bloodtest);
Line bloodtesti = new Line(bloodTestValues);
bloodtesti.setHasLines(false);
bloodtesti.setPointRadius(pointSize * 5 / 4);//3 / 4
bloodtesti.setHasPoints(true);
bloodtesti.setColor(lowColor);//ChartUtils.darkenColor(getCol(X.color_calibration_dot_foreground))
bloodtesti.setShape(ValueShape.SQUARE);
lines.add(bloodtesti);
return lines;
}
示例9: getCalibrationsLine
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
@NonNull
public Line getCalibrationsLine(List<Calibration> calibrations, int color) {
List<PointValue> values = new ArrayList<PointValue>();
for (Calibration calibration : calibrations) {
PointValue point = new PointValue((float)calibration.estimate_raw_at_time_of_calibration, (float)calibration.bg);
String time = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(new Date((long)calibration.raw_timestamp));
point.setLabel(time.toCharArray());
values.add(point);
}
Line line = new Line(values);
line.setColor(color);
line.setHasLines(false);
line.setPointRadius(4);
line.setHasPoints(true);
line.setHasLabels(true);
return line;
}
示例10: cobFutureLine
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public Line cobFutureLine(){
List<PointValue> listValues = new ArrayList<>();
for (int c = 0; c < cobFutureValues.length(); c++) {
try {
if (cobFutureValues.getJSONObject(c).getDouble("display") > yCOBMax) {
listValues.add(new PointValue((float) (cobFutureValues.getJSONObject(c).getDouble("as_of")), (float) yCOBMax.floatValue())); //Do not go above Max COB
} else if (cobFutureValues.getJSONObject(c).getDouble("display") < yCOBMin) {
listValues.add(new PointValue((float) (cobFutureValues.getJSONObject(c).getDouble("as_of")), (float) yCOBMin.floatValue())); //Do not go below Min COB
} else {
listValues.add(new PointValue((float) (cobFutureValues.getJSONObject(c).getDouble("as_of")), (float) cobFutureValues.getJSONObject(c).getDouble("display")));
}
} catch (JSONException e) {
e.printStackTrace();
Crashlytics.logException(e);
}
}
Line cobValuesLine = new Line(listValues);
cobValuesLine.setColor(ChartUtils.COLOR_ORANGE);
cobValuesLine.setHasLines(false);
cobValuesLine.setHasPoints(true);
cobValuesLine.setFilled(false);
cobValuesLine.setCubic(false);
cobValuesLine.setPointRadius(2);
return cobValuesLine;
}
示例11: iobFutureLine
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public Line iobFutureLine() {
List<PointValue> listValues = new ArrayList<>();
for (int c = 0; c < iobFutureValues.length(); c++) {
try {
if (iobFutureValues.getJSONObject(c).getDouble("iob") > yIOBMax) {
listValues.add(new PointValue((float) (iobFutureValues.getJSONObject(c).getDouble("as_of")), (float) fitIOB2COBRange(yIOBMax))); //Do not go above Max IOB
} else if (iobFutureValues.getJSONObject(c).getDouble("iob") < yIOBMin) {
listValues.add(new PointValue((float) (iobFutureValues.getJSONObject(c).getDouble("as_of")), (float) fitIOB2COBRange(yIOBMin))); //Do not go below Min IOB
} else {
listValues.add(new PointValue((float) (iobFutureValues.getJSONObject(c).getDouble("as_of")), (float) fitIOB2COBRange(iobFutureValues.getJSONObject(c).getDouble("iob"))));
}
} catch (JSONException e) {
Crashlytics.logException(e);
e.printStackTrace();
}
}
Line cobValuesLine = new Line(listValues);
cobValuesLine.setColor(ChartUtils.COLOR_BLUE);
cobValuesLine.setHasLines(false);
cobValuesLine.setHasPoints(true);
cobValuesLine.setFilled(false);
cobValuesLine.setCubic(false);
cobValuesLine.setPointRadius(2);
return cobValuesLine;
}
示例12: avg1Line
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public Line avg1Line() {
List<PointValue> myLineValues = new ArrayList<PointValue>();
myLineValues.add(new PointValue((float) avg1startfuzzed, (float) unitized(avg1value)));
myLineValues.add(new PointValue((float) end_time, (float) unitized(avg1value)));
Line myLine = new Line(myLineValues);
myLine.setHasPoints(false);
myLine.setStrokeWidth(1);
myLine.setColor(getCol(X.color_average1_line));
myLine.setPathEffect(new DashPathEffect(new float[]{10.0f, 10.0f}, 0));
myLine.setAreaTransparency(50);
return myLine;
}
示例13: filteredLines
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public ArrayList<Line> filteredLines() {
ArrayList<Line> linearray = new ArrayList<Line>();
float lastx = -999999; // bogus mark value
final float jumpthresh = 15; // in minutes
List<PointValue> thesepoints = new ArrayList<PointValue>();
if (filteredValues.size() > 0) {
final float endmarker = filteredValues.get(filteredValues.size() - 1).getX();
for (PointValue thispoint : filteredValues) {
// a jump too far for a line? make it a new one
if (((lastx != -999999) && (Math.abs(thispoint.getX() - lastx) > jumpthresh))
|| thispoint.getX() == endmarker) {
Line line = new Line(thesepoints);
line.setHasPoints(true);
line.setPointRadius(2);
line.setStrokeWidth(1);
line.setColor(getCol(X.color_filtered));
line.setCubic(true);
line.setHasLines(true);
linearray.add(line);
thesepoints = new ArrayList<PointValue>();
}
lastx = thispoint.getX();
thesepoints.add(thispoint); // grow current line list
}
} else {
UserError.Log.i(TAG, "Raw points size is zero");
}
//UserError.Log.i(TAG, "Returning linearray: " + Integer.toString(linearray.size()));
return linearray;
}
示例14: predictiveHighLine
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public Line predictiveHighLine() {
List<PointValue> predictiveHighLineValues = new ArrayList<PointValue>();
predictiveHighLineValues.add(new PointValue((float) end_time, (float) highMark));
predictiveHighLineValues.add(new PointValue((float) predictive_end_time, (float) highMark));
Line highLine = new Line(predictiveHighLineValues);
highLine.setHasPoints(false);
highLine.setStrokeWidth(1);
highLine.setColor(ChartUtils.darkenColor(ChartUtils.darkenColor(ChartUtils.darkenColor(getCol(X.color_high_values)))));
return highLine;
}
示例15: extraLines
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public List<Line> extraLines()
{
final List<Line> lines = new ArrayList<>();
Line line = new Line(pluginValues);
line.setHasLines(false);
line.setPointRadius(pluginSize);
line.setHasPoints(true);
line.setColor(getCol(X.color_secondary_glucose_value));
lines.add(line);
Line bloodtest = new Line(bloodTestValues);
bloodtest.setHasLines(false);
bloodtest.setPointRadius(pointSize * 3 / 2);
bloodtest.setHasPoints(true);
bloodtest.setColor(ChartUtils.darkenColor(getCol(X.color_calibration_dot_background)));
bloodtest.setShape(ValueShape.SQUARE);
lines.add(bloodtest);
Line bloodtesti = new Line(bloodTestValues);
bloodtesti.setHasLines(false);
bloodtesti.setPointRadius(pointSize * 3 / 4);
bloodtesti.setHasPoints(true);
bloodtesti.setColor(ChartUtils.darkenColor(getCol(X.color_calibration_dot_foreground)));
bloodtesti.setShape(ValueShape.SQUARE);
lines.add(bloodtesti);
return lines;
}