本文整理汇总了Java中lecho.lib.hellocharts.model.Column.setHasLabels方法的典型用法代码示例。如果您正苦于以下问题:Java Column.setHasLabels方法的具体用法?Java Column.setHasLabels怎么用?Java Column.setHasLabels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lecho.lib.hellocharts.model.Column
的用法示例。
在下文中一共展示了Column.setHasLabels方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getColumnsData
import lecho.lib.hellocharts.model.Column; //导入方法依赖的package包/类
private List<Column> getColumnsData(List<DietRecord> records) {
if (records == null || records.size() == 0) {
return null;
}
this.mRecordValues.clear();
List<Column> columnList = new ArrayList();
for (int i = 0; i < records.size(); i++) {
List<SubcolumnValue> values = new ArrayList();
values.add(new SubcolumnValue(((DietRecord) records.get(i)).eating_calory, this
.resources.getColor(R.color.cq)));
values.add(new SubcolumnValue(((DietRecord) records.get(i)).activity_calory, this
.resources.getColor(R.color.i0)));
this.mRecordValues.add(Float.valueOf(((DietRecord) records.get(i)).eating_calory));
this.mRecordValues.add(Float.valueOf(((DietRecord) records.get(i)).activity_calory));
Column column = new Column(values);
column.setHasLabels(true);
columnList.add(column);
}
return columnList;
}
示例2: getColumnsData
import lecho.lib.hellocharts.model.Column; //导入方法依赖的package包/类
private List<Column> getColumnsData(List<StepModel> steps) {
if (steps == null || steps.size() == 0) {
return null;
}
List<Column> columns = new ArrayList();
for (int i = 0; i < steps.size(); i++) {
StepModel step = (StepModel) steps.get(i);
List<SubcolumnValue> values = new ArrayList();
values.add(new SubcolumnValue((float) step.step, ContextCompat.getColor(this.context,
R.color.jv)));
Column column = new Column(values);
column.setHasLabels(true);
columns.add(column);
}
return columns;
}
示例3: addSerieToBarChart
import lecho.lib.hellocharts.model.Column; //导入方法依赖的package包/类
private void addSerieToBarChart(List<Column> values, List<AxisValue> axisValues, String category,
double percent, double ects, int color) {
if (percent > 0) {
axisValues.add(new AxisValue(axisValues.size()).setLabel(category));
ArrayList<SubcolumnValue> subColumns = new ArrayList<>();
SubcolumnValue subColumn = new SubcolumnValue((float) percent, color);
subColumn.setLabel(AppUtils.format(getContext(), "%.2f ECTS", ects));
subColumns.add(subColumn);
Column column = new Column(subColumns);
column.setHasLabels(false);
column.setHasLabelsOnlyForSelected(true);
values.add(column);
}
}
示例4: generateDefaultData
import lecho.lib.hellocharts.model.Column; //导入方法依赖的package包/类
private void generateDefaultData() {
int numSubcolumns = 1;
int numColumns = 8;
// Column can have many subcolumns, here by default I use 1 subcolumn in each of 8 columns.
List<Column> columns = new ArrayList<Column>();
List<SubcolumnValue> values;
for (int i = 0; i < numColumns; ++i) {
values = new ArrayList<SubcolumnValue>();
for (int j = 0; j < numSubcolumns; ++j) {
values.add(new SubcolumnValue((float) Math.random() * 50f + 5, ChartUtils.pickColor()));
}
Column column = new Column(values);
column.setHasLabels(hasLabels);
column.setHasLabelsOnlyForSelected(hasLabelForSelected);
columns.add(column);
}
data = new ColumnChartData(columns);
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);
}
chart.setColumnChartData(data);
}
示例5: generateSubcolumnsData
import lecho.lib.hellocharts.model.Column; //导入方法依赖的package包/类
/**
* Generates columns with subcolumns, columns have larger separation than subcolumns.
*/
private void generateSubcolumnsData() {
int numSubcolumns = 4;
int numColumns = 4;
// Column can have many subcolumns, here I use 4 subcolumn in each of 8 columns.
List<Column> columns = new ArrayList<Column>();
List<SubcolumnValue> values;
for (int i = 0; i < numColumns; ++i) {
values = new ArrayList<SubcolumnValue>();
for (int j = 0; j < numSubcolumns; ++j) {
values.add(new SubcolumnValue((float) Math.random() * 50f + 5, ChartUtils.pickColor()));
}
Column column = new Column(values);
column.setHasLabels(hasLabels);
column.setHasLabelsOnlyForSelected(hasLabelForSelected);
columns.add(column);
}
data = new ColumnChartData(columns);
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);
}
chart.setColumnChartData(data);
}
示例6: generateNegativeSubcolumnsData
import lecho.lib.hellocharts.model.Column; //导入方法依赖的package包/类
private void generateNegativeSubcolumnsData() {
int numSubcolumns = 4;
int numColumns = 4;
List<Column> columns = new ArrayList<Column>();
List<SubcolumnValue> values;
for (int i = 0; i < numColumns; ++i) {
values = new ArrayList<SubcolumnValue>();
for (int j = 0; j < numSubcolumns; ++j) {
int sign = getSign();
values.add(new SubcolumnValue((float) Math.random() * 50f * sign + 5 * sign, ChartUtils.pickColor
()));
}
Column column = new Column(values);
column.setHasLabels(hasLabels);
column.setHasLabelsOnlyForSelected(hasLabelForSelected);
columns.add(column);
}
data = new ColumnChartData(columns);
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);
}
chart.setColumnChartData(data);
}
示例7: generateColumnData
import lecho.lib.hellocharts.model.Column; //导入方法依赖的package包/类
private ColumnChartData generateColumnData() {
int numColumns = DataFetcher.getInstance().getWater().size();
// Column can have many subcolumns, here by default I use 1 subcolumn in each of 8 columns.
List<Column> columns = new ArrayList<Column>();
List<SubcolumnValue> values;
for (int i = 0; i < numColumns; ++i) {
values = new ArrayList<SubcolumnValue>();
float tt = Float.valueOf(DataFetcher.getInstance().getWater().get(i).getValue());
if(tt<=30) {
if(tt<1) {
tt = 1;
}
values.add(new SubcolumnValue(tt, ChartUtils.COLOR_RED));
} else if(30<tt && tt <=60) {
values.add(new SubcolumnValue(tt, ChartUtils.COLOR_ORANGE));
} else {
values.add(new SubcolumnValue(tt, ChartUtils.COLOR_GREEN));
}
Column column = new Column(values);
column.setHasLabels(true);
column.setHasLabelsOnlyForSelected(false);
columns.add(column);
}
ColumnChartData columnChartData = new ColumnChartData(columns);
return columnChartData;
}
示例8: generateTopGraphData
import lecho.lib.hellocharts.model.Column; //导入方法依赖的package包/类
private void generateTopGraphData() {
List<AxisValue> axisValues = new ArrayList<AxisValue>();
List<Column> columns = new ArrayList<Column>();
List<SubcolumnValue> values;
int i = 0;
for (Crop crop : mFirstCompareItemList) {
values = new ArrayList<SubcolumnValue>();
String valueFormatted = "" + uniqueFirstCompareValue.get(crop.getYear());
values.add(new SubcolumnValue(Float.parseFloat(valueFormatted), Color.parseColor("#388E3C")));
Column column = new Column(values);
column.setHasLabels(false);
column.setHasLabelsOnlyForSelected(true);
columns.add(column);
axisValues.add(new AxisValue(i).setLabel(crop.getYear()));
i++;
}
columnDataTop = new ColumnChartData(columns);
columnDataTop.setAxisXBottom(new Axis(axisValues).setHasLines(true));
columnDataTop.setAxisYLeft(new Axis().setHasLines(true));
chartTop.setColumnChartData(columnDataTop);
}
示例9: generateBottomGraphData
import lecho.lib.hellocharts.model.Column; //导入方法依赖的package包/类
private void generateBottomGraphData() {
List<AxisValue> axisValues = new ArrayList<AxisValue>();
List<Column> columns = new ArrayList<Column>();
List<SubcolumnValue> values;
int i = 0;
for (Crop crop : mSecondCompareItemList) {
values = new ArrayList<SubcolumnValue>();
String valueFormatted = "" + uniqueSecondCompareValue.get(crop.getYear());
values.add(new SubcolumnValue(Float.parseFloat(valueFormatted), Color.parseColor("#303F9F")));
Column column = new Column(values);
column.setHasLabels(false);
column.setHasLabelsOnlyForSelected(true);
columns.add(column);
axisValues.add(new AxisValue(i).setLabel(crop.getYear()));
i++;
}
columnDataBottom = new ColumnChartData(columns);
columnDataBottom.setAxisXBottom(new Axis(axisValues).setHasLines(true));
columnDataBottom.setAxisYLeft(new Axis().setHasLines(true));
chartBottom.setColumnChartData(columnDataBottom);
}
示例10: generateTopGraphData
import lecho.lib.hellocharts.model.Column; //导入方法依赖的package包/类
private void generateTopGraphData() {
List<AxisValue> axisValues = new ArrayList<AxisValue>();
List<Column> columns = new ArrayList<Column>();
List<SubcolumnValue> values;
int i = 0;
for (Crop crop : mFirstCompareItemList) {
values = new ArrayList<SubcolumnValue>();
String valueFormatted = "" + uniqueFirstCompareValue.get(crop.getYear());
values.add(new SubcolumnValue(Float.parseFloat(valueFormatted), ChartUtils.pickColor()));
Column column = new Column(values);
column.setHasLabels(false);
column.setHasLabelsOnlyForSelected(true);
columns.add(column);
axisValues.add(new AxisValue(i).setLabel(crop.getYear()));
i++;
}
columnDataTop = new ColumnChartData(columns);
columnDataTop.setAxisXBottom(new Axis(axisValues).setHasLines(true));
columnDataTop.setAxisYLeft(new Axis().setHasLines(true));
chartTop.setColumnChartData(columnDataTop);
}
示例11: generateBottomGraphData
import lecho.lib.hellocharts.model.Column; //导入方法依赖的package包/类
private void generateBottomGraphData() {
List<AxisValue> axisValues = new ArrayList<AxisValue>();
List<Column> columns = new ArrayList<Column>();
List<SubcolumnValue> values;
int i = 0;
for (Crop crop : mSecondCompareItemList) {
values = new ArrayList<SubcolumnValue>();
String valueFormatted = "" + uniqueSecondCompareValue.get(crop.getYear());
values.add(new SubcolumnValue(Float.parseFloat(valueFormatted), ChartUtils.pickColor()));
Column column = new Column(values);
column.setHasLabels(false);
column.setHasLabelsOnlyForSelected(true);
columns.add(column);
axisValues.add(new AxisValue(i).setLabel(crop.getYear()));
i++;
}
columnDataBottom = new ColumnChartData(columns);
columnDataBottom.setAxisXBottom(new Axis(axisValues).setHasLines(true));
columnDataBottom.setAxisYLeft(new Axis().setHasLines(true));
chartBottom.setColumnChartData(columnDataBottom);
}
示例12: generateData
import lecho.lib.hellocharts.model.Column; //导入方法依赖的package包/类
private void generateData() {
List<AxisValue> axisValues = new ArrayList<AxisValue>();
List<Column> columns = new ArrayList<Column>();
List<SubcolumnValue> values;
int i = 0;
for (Crop crop : mCropList) {
values = new ArrayList<SubcolumnValue>();
String valueFormatted = "" + uniqueMapValue.get(crop.getYear());
values.add(new SubcolumnValue(Float.parseFloat(valueFormatted), Color.parseColor("#388E3C")));
Column column = new Column(values);
column.setHasLabels(false);
column.setHasLabelsOnlyForSelected(true);
columns.add(column);
axisValues.add(new AxisValue(i).setLabel(crop.getYear()));
i++;
}
data = new ColumnChartData(columns);
data.setAxisXBottom(new Axis(axisValues).setHasLines(true));
data.setAxisYLeft(new Axis().setHasLines(true));
chart.setColumnChartData(data);
}
示例13: generateStackedData
import lecho.lib.hellocharts.model.Column; //导入方法依赖的package包/类
/**
* Generates columns with stacked subcolumns.
*/
private void generateStackedData() {
int numSubcolumns = 4;
int numColumns = 8;
// Column can have many stacked subcolumns, here I use 4 stacke subcolumn in each of 4 columns.
List<Column> columns = new ArrayList<Column>();
List<SubcolumnValue> values;
for (int i = 0; i < numColumns; ++i) {
values = new ArrayList<SubcolumnValue>();
for (int j = 0; j < numSubcolumns; ++j) {
values.add(new SubcolumnValue((float) Math.random() * 20f + 5, ChartUtils.pickColor()));
}
Column column = new Column(values);
column.setHasLabels(hasLabels);
column.setHasLabelsOnlyForSelected(hasLabelForSelected);
columns.add(column);
}
data = new ColumnChartData(columns);
// Set stacked flag.
data.setStacked(true);
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);
}
chart.setColumnChartData(data);
}
示例14: generateNegativeStackedData
import lecho.lib.hellocharts.model.Column; //导入方法依赖的package包/类
private void generateNegativeStackedData() {
int numSubcolumns = 4;
int numColumns = 8;
// Column can have many stacked subcolumns, here I use 4 stacke subcolumn in each of 4 columns.
List<Column> columns = new ArrayList<Column>();
List<SubcolumnValue> values;
for (int i = 0; i < numColumns; ++i) {
values = new ArrayList<SubcolumnValue>();
for (int j = 0; j < numSubcolumns; ++j) {
int sign = getSign();
values.add(new SubcolumnValue((float) Math.random() * 20f * sign + 5 * sign, ChartUtils.pickColor()));
}
Column column = new Column(values);
column.setHasLabels(hasLabels);
column.setHasLabelsOnlyForSelected(hasLabelForSelected);
columns.add(column);
}
data = new ColumnChartData(columns);
// Set stacked flag.
data.setStacked(true);
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);
}
chart.setColumnChartData(data);
}
示例15: onCreate
import lecho.lib.hellocharts.model.Column; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_chart);
ButterKnife.bind(this);
chart.setContainerScrollEnabled(true, ContainerScrollType.HORIZONTAL);
chart.setZoomType(ZoomType.HORIZONTAL);
ArrayList<com.marco.marplex.schoolbook.models.Materia> list =
Subjects.getSubjects(this, getIntent().getIntExtra("period", 1));
int numColumns = list.size();
// Column can have many subcolumns, here by default I use 1 subcolumn in each column.
List<Column> columns = new ArrayList<Column>();
List<SubcolumnValue> values;
List<AxisValue> axisValues = new ArrayList<AxisValue>();
for (int i = 0; i < numColumns; ++i) {
values = new ArrayList<SubcolumnValue>();
values.add(new SubcolumnValue((float)list.get(i).mediaMateria, ChartUtils.pickColor()));
axisValues.add(new AxisValue(i).setLabel(list.get(i).testoMateria));
Column column = new Column(values);
column.setHasLabels(true);
column.setHasLabelsOnlyForSelected(false);
columns.add(column);
}
ColumnChartData data = new ColumnChartData(columns);
Axis axisX = new Axis(axisValues);
Axis axisY = new Axis().setHasLines(true);
axisY.setName("Media");
data.setAxisXBottom(axisX);
data.setAxisYLeft(axisY);
chart.setColumnChartData(data);
chart.setZoomLevel(0,0, 5f);
}