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


Java Axis.setName方法代码示例

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


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

示例1: generateData

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void generateData() {
    // Chart looks the best when line data and column data have similar maximum viewports.
    data = new ComboLineColumnChartData(generateColumnData(), generateLineData());

    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.setComboLineColumnChartData(data);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:ComboLineColumnChartActivity.java

示例2: generateDefaultData

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的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

示例3: generateSubcolumnsData

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的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

示例4: generateNegativeSubcolumnsData

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的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

示例5: generateData

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

            List<BubbleValue> values = new ArrayList<BubbleValue>();
            for (int i = 0; i < BUBBLES_NUM; ++i) {
                BubbleValue value = new BubbleValue(i, (float) Math.random() * 100, (float) Math.random() * 1000);
                value.setColor(ChartUtils.pickColor());
                value.setShape(shape);
                values.add(value);
            }

            data = new BubbleChartData(values);
            data.setHasLabels(hasLabels);
            data.setHasLabelsOnlyForSelected(hasLabelForSelected);

            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.setBubbleChartData(data);

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

示例6: setBubbleDatas

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void setBubbleDatas() {
    List<BubbleValue> values = new ArrayList<>();
    //设置每个气泡的数据、颜色、形状
    for (int i = 0; i < BUBBLES_NUM; i++) {
        BubbleValue value = new BubbleValue(i, (float) Math.random() * 100, (float) Math.random() * 1000);
        value.setColor(ChartUtils.pickColor());
        value.setShape(bubbleShape);
        value.setLabel(labelStrs[i]);
        values.add(value);
    }

    //设置其他属性
    mBubbleData = new BubbleChartData(values);
    mBubbleData.setHasLabels(isHasLabels);
    mBubbleData.setHasLabelsOnlyForSelected(isBubblesHasSelected);

    //设置坐标轴相关属性
    if (isHasAxes) {
        Axis axisX = new Axis();
        Axis axisY = new Axis().setHasLines(true);
        if (isHasAxesName) {
            axisX.setName("Axis X");
            axisY.setName("Axis Y");
        }
        mBubbleData.setAxisXBottom(axisX);
        mBubbleData.setAxisYLeft(axisY);
    } else {
        mBubbleData.setAxisXBottom(null);
        mBubbleData.setAxisYLeft(null);
    }

    mBubbleView.setBubbleChartData(mBubbleData);
}
 
开发者ID:lupwei,项目名称:Croprotector,代码行数:34,代码来源:disease_kind_chart_fragment.java

示例7: setChartAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void setChartAxis(ColumnChartData data) {
    Axis axisX = new Axis();
    Axis axisY = new Axis().setHasLines(true);
    axisX.setName("s");
    axisY.setName("s");
    data.setAxisXBottom(axisX);
    data.setAxisYLeft(axisY);
}
 
开发者ID:HRVBand,项目名称:hrv-band,代码行数:9,代码来源:MeasuredRRFragment.java

示例8: setAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
/**
 * Sets the properties of the X and Y axis of the chart.
 */
private void setAxis(ColumnChartView mChart, HRVParameterEnum hrvValue) {
    ColumnChartData data = new ColumnChartData(new ArrayList<>(Arrays.asList(columns)));

    Axis axisX = new Axis();
    Axis axisY = new Axis().setHasLines(true);
    axisX.setName(getXAxisLabel());
    axisX.setValues(getXAxisValues());
    axisY.setName(getUnit(hrvValue));
    data.setAxisXBottom(axisX);
    data.setAxisYLeft(axisY);

    mChart.setZoomEnabled(false);
    mChart.setColumnChartData(data);
}
 
开发者ID:HRVBand,项目名称:hrv-band,代码行数:18,代码来源:AbstractChartDrawStrategy.java

示例9: getYAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
@Override
public Axis getYAxis() {
    Axis axis = new Axis();
    axis.setName("m/s*s");
    axis.setHasLines(true);
    return axis;
}
 
开发者ID:vaslabs,项目名称:SDC,代码行数:8,代码来源:AccelerationChartFragment.java

示例10: getYAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
@Override
public Axis getYAxis() {
    Axis axis = new Axis();
    axis.setName("G's");
    axis.setHasLines(true);
    return axis;
}
 
开发者ID:vaslabs,项目名称:SDC,代码行数:8,代码来源:GforceChartFragment.java

示例11: getYAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
@Override
public Axis getYAxis() {
    Axis axis = new Axis();
    axis.setName("Meters");
    axis.setHasLines(true);
    return axis;
}
 
开发者ID:vaslabs,项目名称:SDC,代码行数:8,代码来源:BarometerChartFragment.java

示例12: setDistanceAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void setDistanceAxis(LineChartData data) {
    Axis distAxis = new Axis();
    distAxis.setName(getString(R.string.track_statistics_distance));
    distAxis.setTextColor(getResources().getColor(R.color.blue_dark_cario));
    distAxis.setMaxLabelChars(5);
    distAxis.setFormatter(new SimpleAxisValueFormatter()
            .setAppendedText("km".toCharArray()));
    distAxis.setHasLines(true);
    distAxis.setHasTiltedLabels(true);
    distAxis.setTextSize(10);
    distAxis.setHasSeparationLine(false);
    data.setAxisXBottom(distAxis);
}
 
开发者ID:enviroCar,项目名称:enviroCar-app,代码行数:14,代码来源:TrackStatisticsActivity.java

示例13: setYAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void setYAxis(Measurement.PropertyKey key, LineChartData data) {
    Axis yAxis = new Axis();
    yAxis.setName(getString(key.getStringResource()));
    yAxis.setTextColor(getResources().getColor(R.color.blue_dark_cario));
    yAxis.setMaxLabelChars(3);
    yAxis.setHasLines(true);
    yAxis.setTextSize(10);
    yAxis.setFormatter(new SimpleAxisValueFormatter());
    yAxis.setInside(false);
    yAxis.setHasSeparationLine(false);
    data.setAxisYLeft(yAxis);
}
 
开发者ID:enviroCar,项目名称:enviroCar-app,代码行数:13,代码来源:TrackStatisticsActivity.java

示例14: generateStackedData

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的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

示例15: generateNegativeStackedData

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的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


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