本文整理汇总了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);
}
示例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);
}
示例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);
}