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


Java Column.setHasLabels方法代码示例

本文整理汇总了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;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:21,代码来源:DietChartHelper.java

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

示例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);
    }
}
 
开发者ID:marunjar,项目名称:anewjkuapp,代码行数:17,代码来源:StatCardAdapter.java

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

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

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

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

示例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);
        }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:40,代码来源:ColumnChartActivity.java

示例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;
    }
 
开发者ID:npes87184,项目名称:EnvironmentTW,代码行数:30,代码来源:WaterFragment.java

示例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);
        }
 
开发者ID:beingmiakashs,项目名称:PowAgri,代码行数:29,代码来源:CompareActivity.java

示例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);
        }
 
开发者ID:beingmiakashs,项目名称:PowAgri,代码行数:29,代码来源:CompareActivity.java

示例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);
        }
 
开发者ID:beingmiakashs,项目名称:PowAgri,代码行数:29,代码来源:CompareSelectedCropActivity.java

示例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);
        }
 
开发者ID:beingmiakashs,项目名称:PowAgri,代码行数:29,代码来源:CompareSelectedCropActivity.java

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

        }
 
开发者ID:beingmiakashs,项目名称:PowAgri,代码行数:30,代码来源:ExpensesActivity.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:44,代码来源:ColumnChartActivity.java

示例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);
        }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:43,代码来源:ColumnChartActivity.java

示例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);
}
 
开发者ID:Marplex,项目名称:Schoolbook,代码行数:44,代码来源:ChartActivity.java


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