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


Java Line.setHasLabelsOnlyForSelected方法代码示例

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


在下文中一共展示了Line.setHasLabelsOnlyForSelected方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generateData

import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
private void generateData() {

            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.setShape(shape);
                line.setCubic(isCubic);
                line.setFilled(isFilled);
                line.setHasLabels(hasLabels);
                line.setHasLabelsOnlyForSelected(hasLabelForSelected);
                line.setHasLines(hasLines);
                line.setHasPoints(hasPoints);
                line.setHasGradientToTransparent(hasGradientToTransparent);
                if (pointsHaveDifferentColor){
                    line.setPointColor(ChartUtils.COLORS[(i + 1) % ChartUtils.COLORS.length]);
                }
                lines.add(line);
            }

            data = new LineChartData(lines);

            if (hasAxes) {
                Axis axisX = new Axis();
                Axis axisY = new Axis().setHasLines(true);
                if (hasAxesNames) {
                    axisX.setName("Axis X");
                    axisY.setName("Axis Y");
                }
                data.setAxisXBottom(axisX);
                data.setAxisYLeft(axisY);
            } else {
                data.setAxisXBottom(null);
                data.setAxisYLeft(null);
            }

            data.setBaseValue(Float.NEGATIVE_INFINITY);
            chart.setLineChartData(data);

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

示例2: generateData

import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
private void generateData() {

        List<Line> lines = new ArrayList<Line>();
        Entry e;
        Entry[] entries = getEntries();
        long firstTimestamp = entries[0].getTimestamp();
        for (int i = 0; i < numberOfLines; ++i) {

            List<PointValue> values = new ArrayList<PointValue>();
            for (int j = 0; j < entries.length; ++j) {
                e = entries[j];
                values.add(new PointValue(e.getTimestamp() - firstTimestamp, e.getY()));
            }

            Line line = new Line(values);
            line.setColor(ChartUtils.COLORS[i]);
            line.setShape(shape);
            line.setCubic(isCubic);
            line.setFilled(isFilled);
            line.setHasLabels(hasLabels);
            line.setHasLabelsOnlyForSelected(hasLabelForSelected);
            line.setHasLines(hasLines);
            line.setHasPoints(hasPoints);
            lines.add(line);
        }

        data = new LineChartData(lines);

        if (hasAxes) {
            //Axis axisX = new Axis();
            //Axis axisY = new Axis().setHasLines(true);
            /*if (hasAxesNames) {
                axisX.setName("Axis X");
                axisY.setName("Axis Y");
            }*/
            data.setAxisXBottom(getXAxis());
            data.setAxisYLeft(getYAxis());
        } else {
            data.setAxisXBottom(null);
            data.setAxisYLeft(null);
        }

        data.setBaseValue(Float.NEGATIVE_INFINITY);
        chart.setLineChartData(data);

    }
 
开发者ID:vaslabs,项目名称:SDC,代码行数:47,代码来源:MainFragment.java

示例3: generateData

import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
private void generateData() {
	List<Line> lines = new ArrayList<Line>();
	for (int i = 0; i < 1; i++) {
		// ����Դ
		List<PointValue> values = new ArrayList<PointValue>();
		for (int j = 0; j < listLevel.size(); j++) {
			values.add(new PointValue(j, listLevel.get(j)));
		}
		// ������
		Line line = new Line(values);
		// �����е���ɫ
		line.setColor(ChartUtils.COLORS[i]);
		// ��״
		line.setShape(shape);
		// �Ƿ�������
		line.setCubic(isCubic);
		// ���
		line.setFilled(isFilled);
		// ��ǩ
		line.setHasLabels(hasLabels);
		// ������ѡ�е����ñ�ǩ
		line.setHasLabelsOnlyForSelected(hasLabelsOnlyForSelected);
		// ����
		line.setHasLines(hasLines);
		// ��
		line.setHasPoints(hasPoints);
		lines.add(line);
	}

	data = new LineChartData();
	data.setLines(lines);

	if (hasAxes) {
		Axis axisX = new Axis();
		Axis axisY = new Axis().setHasLines(true);
		if (hasAxesNames) {
			axisX.setName("ʱ��(s)");
			axisY.setName("�ź�ǿ��");
		}
		data.setAxisXBottom(axisX);
		data.setAxisYLeft(axisY);
	} else {
		data.setAxisXBottom(null);
		data.setAxisYLeft(null);
	}

	data.setBaseValue(Float.NEGATIVE_INFINITY);
	mChartView.setLineChartData(data);
}
 
开发者ID:scp504677840,项目名称:ExcellentWiFi,代码行数:50,代码来源:ChartActivity.java


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