当前位置: 首页>>代码示例>>Java>>正文


Java Line.setColor方法代码示例

本文整理汇总了Java中lecho.lib.hellocharts.model.Line.setColor方法的典型用法代码示例。如果您正苦于以下问题:Java Line.setColor方法的具体用法?Java Line.setColor怎么用?Java Line.setColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lecho.lib.hellocharts.model.Line的用法示例。


在下文中一共展示了Line.setColor方法的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;

        }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:25,代码来源:ComboLineColumnChartActivity.java

示例2: generateLineChartData

import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
private LineChartData generateLineChartData() {
    int numValues = 20;

    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);

    List<Line> lines = new ArrayList<Line>();
    lines.add(line);

    LineChartData data = new LineChartData(lines);
    data.setAxisXBottom(new Axis().setName("Axis X"));
    data.setAxisYLeft(new Axis().setName("Axis Y").setHasLines(true));
    return data;

}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:ViewPagerChartsActivity.java

示例3: 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;

}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:23,代码来源:ViewPagerChartsActivity.java

示例4: 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);

}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:PreviewLineChartActivity.java

示例5: 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;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:22,代码来源:ChartHelper.java

示例6: 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;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:23,代码来源:ChartHelper.java

示例7: 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;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:18,代码来源:ChartMeasureHelper.java

示例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;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:22,代码来源:BgGraphBuilder.java

示例9: 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;
}
 
开发者ID:MilosKozak,项目名称:AndroidAPS,代码行数:19,代码来源:BgGraphBuilder.java

示例10: 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;
}
 
开发者ID:StephenBlackWasAlreadyTaken,项目名称:xDrip-Experimental,代码行数:19,代码来源:CalibrationGraph.java

示例11: 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;
}
 
开发者ID:timomer,项目名称:HAPP,代码行数:26,代码来源:IOBCOBLineGraph.java

示例12: 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;
}
 
开发者ID:timomer,项目名称:HAPP,代码行数:26,代码来源:IOBCOBLineGraph.java

示例13: populateMeetingDurationChart

import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public static void populateMeetingDurationChart(Context context, LineChartView chart, @NonNull Cursor cursor) {
    List<PointValue> points = new ArrayList<>();
    List<AxisValue> xAxisValues = new ArrayList<>();

    MeetingCursorWrapper cursorWrapper = new MeetingCursorWrapper(cursor);
    while (cursorWrapper.moveToNext()) {
        Meeting meeting = Meeting.read(context, cursorWrapper);
        points.add(getMeetingDurationPointValue(meeting));
        xAxisValues.add(getMeetingDurationXAxisValue(context, meeting));
    }
    cursor.moveToPosition(-1);

    int lineColor = ResourcesCompat.getColor(context.getResources(), R.color.scrum_chatter_primary_color, null);
    Line line = new Line(points);
    line.setColor(lineColor);
    List<Line> lines = new ArrayList<>();
    lines.add(line);

    LineChartData lineChartData = new LineChartData();
    lineChartData.setLines(lines);
    setupChart(context,
            chart,
            xAxisValues,
            context.getString(R.string.chart_duration),
            lines);
}
 
开发者ID:caarmen,项目名称:scrumchatter,代码行数:27,代码来源:MeetingDurationLineChart.java

示例14: generateLineData

import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
private void generateLineData(int color, float range) {
    // Cancel last animation if not finished.
    chartTop.cancelDataAnimation();

    // Modify data targets
    Line line = lineData.getLines().get(0);// For this example there is always only one line.
    line.setColor(color);
    for (PointValue value : line.getValues()) {
        // Change target only for Y value.
        value.setTarget(value.getX(), (float) Math.random() * range);
    }

    // Start new data animation with 300ms duration;
    chartTop.startDataAnimation(300);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:LineColumnDependencyActivity.java

示例15: setLineDatas

import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
private void setLineDatas(int color, float range) {
    //如果上一个动画未完成 先结束动画
    mLineView.cancelDataAnimation();

    // 设置第几条线变化 默认为第一条线
    Line line = mLineData.getLines().get(0);
    line.setColor(color);
    for (PointValue value : line.getValues()) {
        //这里只是随机值 可以添加相对应的数据
        value.setTarget(value.getX(), (float) Math.random() * range);
    }
    mLineView.startDataAnimation();
}
 
开发者ID:lupwei,项目名称:Croprotector,代码行数:14,代码来源:disease_num_chart_fragment.java


注:本文中的lecho.lib.hellocharts.model.Line.setColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。