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


Java Axis.setAutoGenerated方法代码示例

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


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

示例1: basalVsTempBasalyAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
public Axis basalVsTempBasalyAxis() {
    Axis yAxis = new Axis();
    yAxis.setAutoGenerated(false);
    List<AxisValue> axisValues = new ArrayList<>();

    for(double j = -maxBasal.intValue(); j <= maxBasal.intValue(); j += 1) {
        //axisValues.add(new AxisValue((float)fitIOB2COBRange(j)));
        AxisValue value = new AxisValue((float)j);
        if (j==0){
            value.setLabel("Basal");
        } else if (j>0){
            value.setLabel("+" + String.valueOf(j) + "u");
        } else {
            value.setLabel(String.valueOf(j) + "u");
        }
        axisValues.add(value);
    }
    yAxis.setValues(axisValues);
    yAxis.setHasLines(true);
    yAxis.setMaxLabelChars(5);
    yAxis.setInside(true);
    return yAxis;
}
 
开发者ID:timomer,项目名称:HAPP,代码行数:24,代码来源:BasalVSTempBasalGraph.java

示例2: iobPastyAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
public Axis iobPastyAxis() {
    Axis yAxis = new Axis();
    yAxis.setAutoGenerated(false);
    List<AxisValue> axisValues = new ArrayList<AxisValue>();

    for(int j = 1; j <= 8; j += 1) {
        //axisValues.add(new AxisValue((float)fitIOB2COBRange(j)));
        AxisValue value = new AxisValue(j*10);
        value.setLabel(String.valueOf(j*2) + "u");
        axisValues.add(value);
    }
    yAxis.setTextColor(ChartUtils.COLOR_BLUE);
    yAxis.setValues(axisValues);
    yAxis.setHasLines(true);
    yAxis.setMaxLabelChars(5);
    yAxis.setInside(true);
    return yAxis;
}
 
开发者ID:timomer,项目名称:HAPP,代码行数:19,代码来源:CommonChartSupport.java

示例3: cobPastyAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
public Axis cobPastyAxis() {
    Axis yAxis = new Axis();
    yAxis.setAutoGenerated(false);
    List<AxisValue> axisValues = new ArrayList<AxisValue>();

    for(int j = 1; j <= 8; j += 1) {
        AxisValue value = new AxisValue(j*10);
        value.setLabel(String.valueOf(j*10) + "g");
        axisValues.add(value);
    }
    yAxis.setTextColor(ChartUtils.COLOR_ORANGE);
    yAxis.setValues(axisValues);
    yAxis.setHasLines(true);
    yAxis.setMaxLabelChars(5);
    yAxis.setInside(true);
    return yAxis;
}
 
开发者ID:timomer,项目名称:HAPP,代码行数:18,代码来源:CommonChartSupport.java

示例4: updateChart

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

        List<AxisValue> axisValuesX = new ArrayList<>();
        List<PointValue> pointValues = new ArrayList<>();

        int counter = -1;
        do {
            counter++;

            String date = data.getString(data.getColumnIndex(
                    QuoteHistoricalDataColumns.DATE));
            String bidPrice = data.getString(data.getColumnIndex(
                    QuoteHistoricalDataColumns.BIDPRICE));

            // We have to show chart in right order.
            int x = data.getCount() - 1 - counter;

            // Point for line chart (date, price).
            PointValue pointValue = new PointValue(x, Float.valueOf(bidPrice));
            pointValue.setLabel(date);
            pointValues.add(pointValue);

            // Set labels for x-axis (we have to reduce its number to avoid overlapping text).
            if (counter != 0 && counter % (data.getCount() / 3) == 0) {
                AxisValue axisValueX = new AxisValue(x);
                axisValueX.setLabel(date);
                axisValuesX.add(axisValueX);
            }

        } while (data.moveToNext());

        // Prepare data for chart
        Line line = new Line(pointValues).setColor(Color.WHITE).setCubic(false);
        List<Line> lines = new ArrayList<>();
        lines.add(line);
        LineChartData lineChartData = new LineChartData();
        lineChartData.setLines(lines);

        // Init x-axis
        Axis axisX = new Axis(axisValuesX);
        axisX.setHasLines(true);
        axisX.setMaxLabelChars(4);
        lineChartData.setAxisXBottom(axisX);

        // Init y-axis
        Axis axisY = new Axis();
        axisY.setAutoGenerated(true);
        axisY.setHasLines(true);
        axisY.setMaxLabelChars(4);
        lineChartData.setAxisYLeft(axisY);

        // Update chart with new data.
        mChart.setInteractive(false);
        mChart.setLineChartData(lineChartData);

        // Show chart
        mChart.setVisibility(View.VISIBLE);
        mTabContent.setVisibility(View.VISIBLE);
    }
 
开发者ID:DmitryMalkovich,项目名称:stock-hawk-app,代码行数:60,代码来源:StockDetailFragment.java

示例5: populateMeeting

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
public static void populateMeeting(Context context, ColumnChartView chart, @NonNull Cursor cursor) {
    List<AxisValue> xAxisValues = new ArrayList<>();
    List<Column> columns = new ArrayList<>();

    MeetingMemberCursorWrapper cursorWrapper = new MeetingMemberCursorWrapper(cursor);
    int maxLabelLength = 0;
    while (cursorWrapper.moveToNext()) {
        List<SubcolumnValue> subcolumnValues = new ArrayList<>();
        Column column = new Column(subcolumnValues);

        Long memberId = cursorWrapper.getMemberId();
        String memberName = cursorWrapper.getMemberName();
        float durationInMinutes = (float) cursorWrapper.getDuration() / 60;
        String durationLabel = DateUtils.formatElapsedTime(cursorWrapper.getDuration());

        SubcolumnValue subcolumnValue = new SubcolumnValue();
        subcolumnValue.setValue(durationInMinutes);
        subcolumnValue.setLabel(durationLabel);
        int color = ChartUtils.getMemberColor(context, memberId);
        subcolumnValue.setColor(color);
        subcolumnValues.add(subcolumnValue);

        column.setHasLabels(true);
        column.setValues(subcolumnValues);
        columns.add(column);

        AxisValue xAxisValue = new AxisValue(xAxisValues.size());
        xAxisValue.setLabel(memberName);
        xAxisValues.add(xAxisValue);
        if (memberName.length() > maxLabelLength) maxLabelLength = memberName.length();
    }

    cursor.moveToPosition(-1);

    Axis xAxis = new Axis(xAxisValues);
    xAxis.setAutoGenerated(false);
    //xAxis.setMaxLabelChars(maxLabelLength);
    xAxis.setTextColor(ResourcesCompat.getColor(context.getResources(), R.color.chart_text, null));
    xAxis.setHasTiltedLabels(true);

    ColumnChartData data = new ColumnChartData();
    data.setAxisXBottom(xAxis);
    data.setColumns(columns);
    chart.setInteractive(true);
    chart.setColumnChartData(data);
    chart.setZoomEnabled(true);
    chart.setZoomType(ZoomType.HORIZONTAL);
}
 
开发者ID:caarmen,项目名称:scrumchatter,代码行数:49,代码来源:MeetingSpeakingTimeColumnChart.java


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