本文整理汇总了Java中lecho.lib.hellocharts.model.Line.setPointRadius方法的典型用法代码示例。如果您正苦于以下问题:Java Line.setPointRadius方法的具体用法?Java Line.setPointRadius怎么用?Java Line.setPointRadius使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lecho.lib.hellocharts.model.Line
的用法示例。
在下文中一共展示了Line.setPointRadius方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: rawInterpretedLine
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public Line rawInterpretedLine() {
Line line = new Line(rawInterpretedValues);
line.setHasLines(false);
line.setPointRadius(1);
line.setHasPoints(true);
return line;
}
示例6: filteredLines
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public ArrayList<Line> filteredLines() {
ArrayList<Line> line_array = new ArrayList<Line>();
float last_x_pos = -999999; // bogus mark value
final float jump_threshold = 15; // in minutes
List<PointValue> local_points = new ArrayList<PointValue>();
if (filteredValues.size() > 0) {
final float end_marker = filteredValues.get(filteredValues.size() - 1).getX();
for (PointValue current_point : filteredValues) {
// a jump too far for a line? make it a new one
if (((last_x_pos != -999999) && (Math.abs(current_point.getX() - last_x_pos) > jump_threshold))
|| current_point.getX() == end_marker) {
Line line = new Line(local_points);
line.setHasPoints(true);
line.setPointRadius(2);
line.setStrokeWidth(1);
line.setColor(Color.parseColor("#a0a0a0"));
line.setCubic(true);
line.setHasLines(true);
line_array.add(line);
local_points = new ArrayList<PointValue>();
}
last_x_pos = current_point.getX();
local_points.add(current_point); // grow current line list
}
}
return line_array;
}
示例7: 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;
}
示例8: 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;
}
示例9: build
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public Bitmap build() {
List<Line> lines = new ArrayList<>();
bgGraphBuilder.defaultLines();
lines.add(bgGraphBuilder.inRangeValuesLine());
lines.add(bgGraphBuilder.lowValuesLine());
lines.add(bgGraphBuilder.highValuesLine());
if (showLowLine)
lines.add(bgGraphBuilder.lowLine());
if (showHighLine)
lines.add(bgGraphBuilder.highLine());
if (useSmallDots) {
for(Line line: lines)
line.setPointRadius(2);
}
LineChartData lineData = new LineChartData(lines);
if (showAxes) {
lineData.setAxisYLeft(bgGraphBuilder.yAxis());
lineData.setAxisXBottom(bgGraphBuilder.xAxis());
}
//lines.add(bgGraphBuilder.rawInterpretedLine());
chart.setLineChartData(lineData);
Viewport viewport = chart.getMaximumViewport();
viewport.left = start;
viewport.right = end;
chart.setViewportCalculationEnabled(false);
chart.setInteractive(false);
chart.setCurrentViewport(viewport);
chart.setPadding(0, 0, 0, 0);
chart.setLeft(0);
chart.setTop(0);
chart.setRight(width);
chart.setBottom(height);
return getViewBitmap(chart);
}
示例10: build
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
Bitmap build() {
List<Line> lines = new ArrayList<>();
bgGraphBuilder.defaultLines();
lines.add(bgGraphBuilder.inRangeValuesLine());
lines.add(bgGraphBuilder.lowValuesLine());
lines.add(bgGraphBuilder.highValuesLine());
if (showLowLine)
lines.add(bgGraphBuilder.lowLine());
if (showHighLine)
lines.add(bgGraphBuilder.highLine());
if (useSmallDots) {
for(Line line: lines)
line.setPointRadius(1);
}
LineChartData lineData = new LineChartData(lines);
if (showAxes) {
lineData.setAxisYLeft(bgGraphBuilder.yAxis());
lineData.setAxisXBottom(bgGraphBuilder.xAxis());
}
//lines.add(bgGraphBuilder.rawInterpretedLine());
chart.setLineChartData(lineData);
Viewport viewport = chart.getMaximumViewport();
viewport.left = start;
viewport.right = end;
chart.setViewportCalculationEnabled(false);
chart.setInteractive(false);
chart.setCurrentViewport(viewport);
chart.setPadding(0,0,0,0);
chart.setLeft(0);
chart.setTop(0);
chart.setRight(width);
chart.setBottom(height);
return getViewBitmap(chart);
}
示例11: updateGraph
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
private void updateGraph(List<MonthlyPvDatum> monthlyPvData,
List<MonthlyPvDatum> previousYearMonthlyPvData) {
LinearLayout graphLinearLayout = (LinearLayout) fragmentView.findViewById(graph);
graphLinearLayout.removeAllViews();
final Context context = getContext();
if (context != null) {
ComboLineColumnChartView comboLineColumnChartView = new ComboLineColumnChartView(context);
graphLinearLayout.addView(comboLineColumnChartView);
List<Column> columns = new ArrayList<>();
List<SubcolumnValue> subcolumnValues;
for (int i = 0; i < monthlyPvData.size(); i++) {
MonthlyPvDatum monthlyPvDatum = monthlyPvData.get(i);
subcolumnValues = new ArrayList<>();
subcolumnValues.add(new SubcolumnValue(
((float) monthlyPvDatum.getEnergyGenerated()) / 1000,
ChartUtils.COLORS[0]));
columns.add(new Column(subcolumnValues));
}
List<Line> lines = new ArrayList<>();
List<PointValue> lineValues = new ArrayList<>();
for (int i = 0; i < previousYearMonthlyPvData.size(); i++) {
MonthlyPvDatum previousYearMonthlyPvDatum = previousYearMonthlyPvData.get(i);
lineValues.add(new PointValue(i,
((float) previousYearMonthlyPvDatum.getEnergyGenerated()) / 1000));
}
Line line = new Line(lineValues);
line.setPointRadius(3);
line.setHasLines(false);
lines.add(line);
ComboLineColumnChartData comboLineColumnChartData = new ComboLineColumnChartData(
new ColumnChartData(columns), new LineChartData(lines));
RecordPvDatum recordPvDatum = pvDataOperations.loadRecord();
double yAxisMax = Math.max(recordPvDatum.getMonthlyEnergyGenerated() / 1000, 1.0);
AxisLabelValues axisLabelValues = FormatUtils.getAxisLabelValues(yAxisMax);
Axis yAxis = Axis
.generateAxisFromRange(0, axisLabelValues.getMax(), axisLabelValues.getStep())
.setMaxLabelChars(6)
.setTextColor(Color.GRAY)
.setHasLines(true);
yAxis.setName(getResources().getString(R.string.graph_legend_energy));
comboLineColumnChartData.setAxisYLeft(yAxis);
comboLineColumnChartView.setComboLineColumnChartData(comboLineColumnChartData);
comboLineColumnChartView.setViewportCalculationEnabled(false);
Viewport viewport = new Viewport(
-1, axisLabelValues.getView(), monthlyPvData.size() + 1, 0);
comboLineColumnChartView.setMaximumViewport(viewport);
comboLineColumnChartView.setCurrentViewport(viewport);
}
}
示例12: updateGraph
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
private void updateGraph(List<DailyPvDatum> dailyPvData,
List<DailyPvDatum> previousYearDailyPvData) {
LinearLayout graphLinearLayout = (LinearLayout) fragmentView.findViewById(graph);
graphLinearLayout.removeAllViews();
final Context context = getContext();
if (context != null) {
ComboLineColumnChartView comboLineColumnChartView = new ComboLineColumnChartView(context);
graphLinearLayout.addView(comboLineColumnChartView);
List<Column> columns = new ArrayList<>();
List<SubcolumnValue> subcolumnValues;
for (int i = 0; i < dailyPvData.size(); i++) {
DailyPvDatum dailyPvDatum = dailyPvData.get(i);
subcolumnValues = new ArrayList<>();
subcolumnValues.add(new SubcolumnValue(
((float) dailyPvDatum.getEnergyGenerated()) / 1000,
ChartUtils.COLORS[0]));
columns.add(new Column(subcolumnValues));
}
List<Line> lines = new ArrayList<>();
List<PointValue> lineValues = new ArrayList<>();
for (int i = 0; i < previousYearDailyPvData.size(); i++) {
DailyPvDatum previousYearDailyPvDatum = previousYearDailyPvData.get(i);
lineValues.add(new PointValue(i,
((float) previousYearDailyPvDatum.getEnergyGenerated()) / 1000));
}
Line line = new Line(lineValues);
line.setPointRadius(3);
line.setHasLines(false);
lines.add(line);
ComboLineColumnChartData comboLineColumnChartData = new ComboLineColumnChartData(
new ColumnChartData(columns), new LineChartData(lines));
RecordPvDatum recordPvDatum = pvDataOperations.loadRecord();
double yAxisMax = Math.max(recordPvDatum.getDailyEnergyGenerated() / 1000, 1.0);
AxisLabelValues axisLabelValues = FormatUtils.getAxisLabelValues(yAxisMax);
Axis yAxis = Axis
.generateAxisFromRange(0, axisLabelValues.getMax(), axisLabelValues.getStep())
.setMaxLabelChars(6)
.setTextColor(Color.GRAY)
.setHasLines(true);
yAxis.setName(getResources().getString(R.string.graph_legend_energy));
comboLineColumnChartData.setAxisYLeft(yAxis);
comboLineColumnChartView.setComboLineColumnChartData(comboLineColumnChartData);
comboLineColumnChartView.setViewportCalculationEnabled(false);
Viewport viewport = new Viewport(
-1, axisLabelValues.getView(), dailyPvData.size() + 1, 0);
comboLineColumnChartView.setMaximumViewport(viewport);
comboLineColumnChartView.setCurrentViewport(viewport);
}
}
示例13: motionLine
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
private List<Line> motionLine() {
final ArrayList<ActivityRecognizedService.motionData> motion_datas = ActivityRecognizedService.getForGraph((long) start_time * FUZZER, (long) end_time * FUZZER);
List<PointValue> linePoints = new ArrayList<>();
final float ypos = (float)highMark;
int last_type = -9999;
final ArrayList<Line> line_array = new ArrayList<>();
Log.d(TAG,"Motion datas size: "+motion_datas.size());
if (motion_datas.size() > 0) {
motion_datas.add(new ActivityRecognizedService.motionData((long) end_time * FUZZER, DetectedActivity.UNKNOWN)); // terminator
for (ActivityRecognizedService.motionData item : motion_datas) {
Log.d(TAG, "Motion detail: " + JoH.dateTimeText(item.timestamp) + " activity: " + item.activity);
if ((last_type != -9999) && (last_type != item.activity)) {
extend_line(linePoints, item.timestamp / FUZZER, ypos);
Line new_line = new Line(linePoints);
new_line.setHasLines(true);
new_line.setPointRadius(0);
new_line.setStrokeWidth(1);
new_line.setAreaTransparency(40);
new_line.setHasPoints(false);
new_line.setFilled(true);
switch (last_type) {
case DetectedActivity.IN_VEHICLE:
new_line.setColor(Color.parseColor("#70445599"));
break;
case DetectedActivity.ON_FOOT:
new_line.setColor(Color.parseColor("#70995599"));
break;
}
line_array.add(new_line);
linePoints = new ArrayList<>();
}
//current
switch (item.activity) {
case DetectedActivity.ON_FOOT:
case DetectedActivity.IN_VEHICLE:
extend_line(linePoints, item.timestamp / FUZZER, ypos);
last_type = item.activity;
break;
default:
// do nothing?
break;
}
}
}
Log.d(TAG,"Motion array size: "+line_array.size());
return line_array;
}
示例14: getCalibrationsLine
import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
@NonNull
public List<Line> getCalibrationsLine(List<Calibration> calibrations, int color) {
if (calibrations == null) return new ArrayList<>();
List<PointValue> values = new ArrayList<PointValue>();
List<PointValue> valuesb = new ArrayList<PointValue>();
List<PointValue> valuesc = new ArrayList<PointValue>();
for (Calibration calibration : calibrations) {
if (calibration.estimate_raw_at_time_of_calibration > end_x) {
end_x = calibration.estimate_raw_at_time_of_calibration;
}
PointValue point = new PointValue((float) calibration.estimate_raw_at_time_of_calibration,
doMgdl ? (float) calibration.bg : ((float) calibration.bg) * (float) Constants.MGDL_TO_MMOLL);
PointValue pointb = new PointValue((float) calibration.raw_value,
doMgdl ? (float) calibration.bg : ((float) calibration.bg) * (float) Constants.MGDL_TO_MMOLL);
PointValue pointc = new PointValue((float) calibration.adjusted_raw_value,
doMgdl ? (float) calibration.bg : ((float) calibration.bg) * (float) Constants.MGDL_TO_MMOLL);
String time;
if (show_days_since) {
final int days_ago = daysAgo(calibration.raw_timestamp);
time = (days_ago > 0) ? Integer.toString(days_ago) + "d " : "";
time = time + (JoH.hourMinuteString(calibration.raw_timestamp));
} else {
time = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(new Date((long) calibration.raw_timestamp));
}
point.setLabel(time);
values.add(point);
// extra points showing real raw and age_adjusted raw for each calbration point
valuesb.add(pointb);
valuesc.add(pointc);
}
Line line = new Line(values);
line.setColor(color);
line.setHasLines(false);
line.setPointRadius(4);
line.setHasPoints(true);
line.setHasLabels(true);
List<Line> lines = new ArrayList<>();
lines.add(line);
if (Pref.getBooleanDefaultFalse("engineering_mode")) {
// actual raw
Line lineb = new Line(valuesb);
lineb.setColor(Color.RED);
lineb.setHasLines(false);
lineb.setPointRadius(1);
lineb.setHasPoints(true);
lineb.setHasLabels(false);
// age adjusted raw
Line linec = new Line(valuesc);
linec.setColor(Color.YELLOW);
linec.setHasLines(false);
linec.setPointRadius(1);
linec.setHasPoints(true);
linec.setHasLabels(false);
lines.add(lineb);
lines.add(linec);
}
return lines;
}