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


Java LineChartData.setAxisXBottom方法代码示例

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


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

示例1: generateLineChartData

import lecho.lib.hellocharts.model.LineChartData; //导入方法依赖的package包/类
private LineChartData generateLineChartData() {
    int numValues = 20;

    List<PointValue> values = new ArrayList<PointValue>();
    for (int i = 0; i < numValues; ++i) {
        values.add(new PointValue(i, (float) Math.random() * 100f));
    }

    Line line = new Line(values);
    line.setColor(ChartUtils.COLOR_GREEN);

    List<Line> lines = new ArrayList<Line>();
    lines.add(line);

    LineChartData data = new LineChartData(lines);
    data.setAxisXBottom(new Axis().setName("Axis X"));
    data.setAxisYLeft(new Axis().setName("Axis Y").setHasLines(true));
    return data;

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

示例2: generatePreviewLineChartData

import lecho.lib.hellocharts.model.LineChartData; //导入方法依赖的package包/类
private LineChartData generatePreviewLineChartData() {
    int numValues = 50;

    List<PointValue> values = new ArrayList<PointValue>();
    for (int i = 0; i < numValues; ++i) {
        values.add(new PointValue(i, (float) Math.random() * 100f));
    }

    Line line = new Line(values);
    line.setColor(ChartUtils.DEFAULT_DARKEN_COLOR);
    line.setHasPoints(false);// too many values so don't draw points.

    List<Line> lines = new ArrayList<Line>();
    lines.add(line);

    LineChartData data = new LineChartData(lines);
    data.setAxisXBottom(new Axis());
    data.setAxisYLeft(new Axis().setHasLines(true));

    return data;

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

示例3: generateDefaultData

import lecho.lib.hellocharts.model.LineChartData; //导入方法依赖的package包/类
private void generateDefaultData() {
    int numValues = 50;

    List<PointValue> values = new ArrayList<PointValue>();
    for (int i = 0; i < numValues; ++i) {
        values.add(new PointValue(i, (float) Math.random() * 100f));
    }

    Line line = new Line(values);
    line.setColor(ChartUtils.COLOR_GREEN);
    line.setHasPoints(false);// too many values so don't draw points.

    List<Line> lines = new ArrayList<Line>();
    lines.add(line);

    data = new LineChartData(lines);
    data.setAxisXBottom(new Axis());
    data.setAxisYLeft(new Axis().setHasLines(true));

    // prepare preview data, is better to use separate deep copy for preview chart.
    // Set color to grey to make preview area more visible.
    previewData = new LineChartData(data);
    previewData.getLines().get(0).setColor(ChartUtils.DEFAULT_DARKEN_COLOR);

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

示例4: setUpChartLine

import lecho.lib.hellocharts.model.LineChartData; //导入方法依赖的package包/类
private void setUpChartLine() {
    List<PointValue> chartPoints = getChartPoints();
    List<AxisValue> chartAxisPoints = getChartAxisPoints();

    Line chartLine = new Line(chartPoints)
            .setColor(getResources().getColor(R.color.background_primary_dark))
            .setCubic(true)
            .setHasPoints(false);

    LineChartData chartData = new LineChartData()
            .setLines(Collections.singletonList(chartLine));
    chartData.setAxisXBottom(new Axis()
            .setValues(chartAxisPoints));
    chartData.setAxisYLeft(new Axis()
            .setHasLines(true));

    chart.setLineChartData(chartData);
}
 
开发者ID:hawkular,项目名称:hawkular-android-client,代码行数:19,代码来源:MetricCounterFragment.java

示例5: setUpChartLine

import lecho.lib.hellocharts.model.LineChartData; //导入方法依赖的package包/类
private void setUpChartLine() {
    List<PointValue> chartPoints = getChartPoints();
    List<AxisValue> chartAxisPoints = getChartAxisPoints();

    Line chartLine = new Line(chartPoints)
        .setColor(getResources().getColor(R.color.background_primary_dark))
        .setCubic(true)
        .setHasPoints(false);

    LineChartData chartData = new LineChartData()
        .setLines(Collections.singletonList(chartLine));
    chartData.setAxisXBottom(new Axis()
        .setValues(chartAxisPoints));
    chartData.setAxisYLeft(new Axis()
        .setHasLines(true));

    chart.setLineChartData(chartData);
}
 
开发者ID:hawkular,项目名称:hawkular-android-client,代码行数:19,代码来源:MetricGaugeFragment.java

示例6: generateInitialLineData

import lecho.lib.hellocharts.model.LineChartData; //导入方法依赖的package包/类
/**
 * Generates initial data for line chart. At the begining all Y values are equals 0. That will change when user
 * will select value on column chart.
 */
private void generateInitialLineData() {
    int numValues = 7;

    List<AxisValue> axisValues = new ArrayList<AxisValue>();
    List<PointValue> values = new ArrayList<PointValue>();
    for (int i = 0; i < numValues; ++i) {
        values.add(new PointValue(i, 0));
        axisValues.add(new AxisValue(i).setLabel(days[i]));
    }

    Line line = new Line(values);
    line.setColor(ChartUtils.COLOR_GREEN).setCubic(true);

    List<Line> lines = new ArrayList<Line>();
    lines.add(line);

    lineData = new LineChartData(lines);
    lineData.setAxisXBottom(new Axis(axisValues).setHasLines(true));
    lineData.setAxisYLeft(new Axis().setHasLines(true).setMaxLabelChars(3));

    chartTop.setLineChartData(lineData);

    // For build-up animation you have to disable viewport recalculation.
    chartTop.setViewportCalculationEnabled(false);

    // And set initial max viewport and current viewport- remember to set viewports after data.
    Viewport v = new Viewport(0, 110, 6, 0);
    chartTop.setMaximumViewport(v);
    chartTop.setCurrentViewport(v);

    chartTop.setZoomType(ZoomType.HORIZONTAL);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:37,代码来源:LineColumnDependencyActivity.java

示例7: setLinData

import lecho.lib.hellocharts.model.LineChartData; //导入方法依赖的package包/类
private void setLinData() {
    LineChartData lineData = new LineChartData(getLines());
    lineData.setAxisXBottom(new Axis(this.mAxisValues).setHasLines(true).setTextColor(this
            .mContext.getResources().getColor(R.color.jo)).setLineColor(this.mContext
            .getResources().getColor(R.color.jp)));
    lineData.setAxisYLeft(new Axis().setHasLines(true).setMaxLabelChars(3));
    this.lineChart.setViewportCalculationEnabled(false);
    this.lineChart.setZoomEnabled(false);
    this.lineChart.setLineChartData(lineData);
    this.lineChart.setVisibility(0);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:12,代码来源:ChartMeasureHelper.java

示例8: setInitialLineDatas

import lecho.lib.hellocharts.model.LineChartData; //导入方法依赖的package包/类
public void setInitialLineDatas(){
    int numValues = 7;                      //7个值 注意与定义的X轴数量相同

    List<AxisValue> axisValues = new ArrayList<>();
    List<PointValue> values = new ArrayList<>();

    //设置默认值 都为0
    for (int i = 0; i < numValues; ++i) {
        values.add(new PointValue(i, 0));
        axisValues.add(new AxisValue(i).setLabel(dayStrs[i]));
    }

    //设置线
    Line line = new Line(values);
    line.setColor(ChartUtils.COLOR_GREEN).setCubic(true);

    List<Line> lines = new ArrayList<>();
    lines.add(line);

    //对数据进行一些设置 类似Line Chart
    mLineData = new LineChartData(lines);
    mLineData.setAxisXBottom(new Axis(axisValues).setHasLines(true));
    mLineData.setAxisYLeft(new Axis().setHasLines(true).setMaxLabelChars(3));
    mLineView.setLineChartData(mLineData);
    mLineView.setViewportCalculationEnabled(false);

    //设置到窗口上
    Viewport v = new Viewport(0, 110, 6, -5);   //防止曲线超过范围 边界保护
    mLineView.setMaximumViewport(v);
    mLineView.setCurrentViewport(v);
    mLineView.setZoomType(ZoomType.HORIZONTAL);
}
 
开发者ID:lupwei,项目名称:Croprotector,代码行数:33,代码来源:disease_num_chart_fragment.java

示例9: build

import lecho.lib.hellocharts.model.LineChartData; //导入方法依赖的package包/类
public Bitmap build() {
    List<Line> lines = new ArrayList<>();
    bgGraphBuilder.defaultLines();
    lines.add(bgGraphBuilder.inRangeValuesLine());
    lines.add(bgGraphBuilder.lowValuesLine());
    lines.add(bgGraphBuilder.highValuesLine());
    if (showLowLine)
        lines.add(bgGraphBuilder.lowLine());
    if (showHighLine)
        lines.add(bgGraphBuilder.highLine());
    if (useSmallDots) {
        for(Line line: lines)
            line.setPointRadius(2);
    }
    LineChartData lineData = new LineChartData(lines);
    if (showAxes) {
        lineData.setAxisYLeft(bgGraphBuilder.yAxis());
        lineData.setAxisXBottom(bgGraphBuilder.xAxis());
    }
    //lines.add(bgGraphBuilder.rawInterpretedLine());
    chart.setLineChartData(lineData);
    Viewport viewport = chart.getMaximumViewport();
    viewport.left = start;
    viewport.right = end;
    chart.setViewportCalculationEnabled(false);
    chart.setInteractive(false);
    chart.setCurrentViewport(viewport);
    chart.setPadding(0, 0, 0, 0);
    chart.setLeft(0);
    chart.setTop(0);
    chart.setRight(width);
    chart.setBottom(height);
    return getViewBitmap(chart);
}
 
开发者ID:StephenBlackWasAlreadyTaken,项目名称:NightWatch,代码行数:35,代码来源:BgSparklineBuilder.java

示例10: build

import lecho.lib.hellocharts.model.LineChartData; //导入方法依赖的package包/类
Bitmap build() {
    List<Line> lines = new ArrayList<>();
    bgGraphBuilder.defaultLines();
    lines.add(bgGraphBuilder.inRangeValuesLine());
    lines.add(bgGraphBuilder.lowValuesLine());
    lines.add(bgGraphBuilder.highValuesLine());
    if (showLowLine)
        lines.add(bgGraphBuilder.lowLine());
    if (showHighLine)
        lines.add(bgGraphBuilder.highLine());
    if (useSmallDots) {
        for(Line line: lines)
            line.setPointRadius(1);
    }
    LineChartData lineData = new LineChartData(lines);
    if (showAxes) {
        lineData.setAxisYLeft(bgGraphBuilder.yAxis());
        lineData.setAxisXBottom(bgGraphBuilder.xAxis());
    }
    //lines.add(bgGraphBuilder.rawInterpretedLine());
    chart.setLineChartData(lineData);
    Viewport viewport = chart.getMaximumViewport();
    viewport.left = start;
    viewport.right = end;
    chart.setViewportCalculationEnabled(false);
    chart.setInteractive(false);
    chart.setCurrentViewport(viewport);
    chart.setPadding(0,0,0,0);
    chart.setLeft(0);
    chart.setTop(0);
    chart.setRight(width);
    chart.setBottom(height);
    return getViewBitmap(chart);
}
 
开发者ID:StephenBlackWasAlreadyTaken,项目名称:NightWatch,代码行数:35,代码来源:BgSparklineBuilder.java

示例11: iobcobPastLineData

import lecho.lib.hellocharts.model.LineChartData; //导入方法依赖的package包/类
public LineChartData iobcobPastLineData() {
    LineChartData lineData = new LineChartData(iobcobPastdefaultLines());
    lineData.setAxisYLeft(iobPastyAxis());
    lineData.setAxisYRight(cobPastyAxis());
    lineData.setAxisXBottom(xAxis());
    Log.d(TAG, "Updated");
    return lineData;
}
 
开发者ID:timomer,项目名称:HAPP,代码行数:9,代码来源:IOBCOBLineGraph.java

示例12: basalvsTempBasalData

import lecho.lib.hellocharts.model.LineChartData; //导入方法依赖的package包/类
public LineChartData basalvsTempBasalData() {
    LineChartData lineData = new LineChartData(addBasalvsTempBasaLines());
    lineData.setAxisYLeft(basalVsTempBasalyAxis());
    //lineData.setAxisYRight(cobPastyAxis());
    lineData.setAxisXBottom(xAxis());
    return lineData;
}
 
开发者ID:timomer,项目名称:HAPP,代码行数:8,代码来源:BasalVSTempBasalGraph.java

示例13: setupChart

import lecho.lib.hellocharts.model.LineChartData; //导入方法依赖的package包/类
private static void setupChart(Context context, LineChartView chart, List<AxisValue> xAxisValues, String yAxisLabel, List<Line> lines) {
    Axis xAxis = new Axis(xAxisValues);
    ChartUtils.setupXAxis(context, xAxis);
    Axis yAxis = new Axis();
    ChartUtils.setupYAxis(context, yAxisLabel, yAxis);
    LineChartData lineChartData = new LineChartData();
    lineChartData.setAxisXBottom(xAxis);
    lineChartData.setAxisYLeft(yAxis);
    lineChartData.setLines(lines);
    chart.setZoomEnabled(true);
    chart.setZoomType(ZoomType.HORIZONTAL);
    chart.setLineChartData(lineChartData);
    resetViewport(chart);
}
 
开发者ID:caarmen,项目名称:scrumchatter,代码行数:15,代码来源:MeetingDurationLineChart.java

示例14: generateData

import lecho.lib.hellocharts.model.LineChartData; //导入方法依赖的package包/类
private void generateData(Measurement.PropertyKey propertyKey) {
    // Generate the PointValues for the Graph.
    List<PointValue> values = generateDistancedBasedData(propertyKey, mTrack);

    Line line = new Line(values);
    line.setColor(getResources().getColor(R.color.green_dark_cario));
    line.setHasPoints(false);

    List<Line> lines = new ArrayList<>();
    lines.add(line);

    mChartData = new LineChartData(lines);
    mChartData.setAxisXBottom(new Axis());
    mChartData.setAxisYLeft(new Axis().setHasLines(true));
    setDistanceAxis(mChartData);
    setYAxis(propertyKey, mChartData);

    mPreviewChartData = new LineChartData(mChartData);
    mPreviewChartData.getLines().get(0).setColor(ChartUtils.DEFAULT_DARKEN_COLOR);

    Axis axisXBottom = mPreviewChartData.getAxisXBottom();
    axisXBottom.setHasSeparationLine(false);
    axisXBottom.setHasTiltedLabels(true);
    axisXBottom.setTextColor(ChartUtils.DEFAULT_DARKEN_COLOR);

    mPreviewChartData.getAxisYLeft().setTextColor(ChartUtils.DEFAULT_DARKEN_COLOR);

    // Set the data in the charts.
    mChart.setLineChartData(mChartData);
    mPreviewChart.setLineChartData(mPreviewChartData);

    // set the preview extent
    previewX();
}
 
开发者ID:enviroCar,项目名称:enviroCar-app,代码行数:35,代码来源:TrackStatisticsActivity.java

示例15: setDistanceAxis

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


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