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


Java CombinedChart.getAxisLeft方法代码示例

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


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

示例1: onCreate

import com.github.mikephil.charting.charts.CombinedChart; //导入方法依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_combined);

        mChart = (CombinedChart) findViewById(R.id.chart1);
        mChart.setDescription("");
        mChart.setBackgroundColor(Color.WHITE);
        mChart.setDrawGridBackground(false);
        mChart.setDrawBarShadow(false);
        
        // draw bars behind lines
        mChart.setDrawOrder(new DrawOrder[] {
                DrawOrder.BAR, DrawOrder.BUBBLE, DrawOrder.CANDLE, DrawOrder.LINE, DrawOrder.SCATTER
        });

        YAxis rightAxis = mChart.getAxisRight();
        rightAxis.setDrawGridLines(false);
        rightAxis.setAxisMinValue(0f); // this replaces setStartAtZero(true)

        YAxis leftAxis = mChart.getAxisLeft();
        leftAxis.setDrawGridLines(false);
        leftAxis.setAxisMinValue(0f); // this replaces setStartAtZero(true)

        XAxis xAxis = mChart.getXAxis();
        xAxis.setPosition(XAxisPosition.BOTH_SIDED);

        CombinedData data = new CombinedData(mMonths);

        data.setData(generateLineData());
        data.setData(generateBarData());
//        data.setData(generateBubbleData());
//         data.setData(generateScatterData());
//         data.setData(generateCandleData());

        mChart.setData(data);
        mChart.invalidate();
    }
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:41,代码来源:CombinedChartActivity.java

示例2: onCreate

import com.github.mikephil.charting.charts.CombinedChart; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_combined);

    mChart = (CombinedChart) findViewById(R.id.chart1);
    mChart.getDescription().setEnabled(false);
    mChart.setBackgroundColor(Color.WHITE);
    mChart.setDrawGridBackground(false);
    mChart.setDrawBarShadow(false);
    mChart.setHighlightFullBarEnabled(false);

    // draw bars behind lines
    mChart.setDrawOrder(new DrawOrder[]{
            DrawOrder.BAR, DrawOrder.BUBBLE, DrawOrder.CANDLE, DrawOrder.LINE, DrawOrder.SCATTER
    });

    Legend l = mChart.getLegend();
    l.setWordWrapEnabled(true);
    l.setVerticalAlignment(Legend.LegendVerticalAlignment.BOTTOM);
    l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.CENTER);
    l.setOrientation(Legend.LegendOrientation.HORIZONTAL);
    l.setDrawInside(false);

    YAxis rightAxis = mChart.getAxisRight();
    rightAxis.setDrawGridLines(false);
    rightAxis.setAxisMinimum(0f); // this replaces setStartAtZero(true)

    YAxis leftAxis = mChart.getAxisLeft();
    leftAxis.setDrawGridLines(false);
    leftAxis.setAxisMinimum(0f); // this replaces setStartAtZero(true)

    XAxis xAxis = mChart.getXAxis();
    xAxis.setPosition(XAxisPosition.BOTH_SIDED);
    xAxis.setAxisMinimum(0f);
    xAxis.setGranularity(1f);
    xAxis.setValueFormatter(new IAxisValueFormatter() {
        @Override
        public String getFormattedValue(float value, AxisBase axis) {
            return mMonths[(int) value % mMonths.length];
        }
    });

    CombinedData data = new CombinedData();

    data.setData(generateLineData());
    data.setData(generateBarData());
    data.setData(generateBubbleData());
    data.setData(generateScatterData());
    data.setData(generateCandleData());
    data.setValueTypeface(mTfLight);

    xAxis.setAxisMaximum(data.getXMax() + 0.25f);

    mChart.setData(data);
    mChart.invalidate();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:60,代码来源:CombinedChartActivity.java

示例3: onCreate

import com.github.mikephil.charting.charts.CombinedChart; //导入方法依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mChart = (CombinedChart) findViewById(R.id.chart1);
        //描述
        mChart.getDescription().setEnabled(false);

        mChart.setBackgroundColor(Color.WHITE);

        mChart.setDrawGridBackground(false);
        mChart.setDrawBarShadow(false);
        mChart.setHighlightFullBarEnabled(false);

        mChart.setScaleEnabled(false);
        mChart.setScaleYEnabled(false);
        mChart.setScaleXEnabled(false);

        mChart.setPinchZoom(false);
//        mChart.setScaleMinima(2f, 1f);
//        mChart.setAutoScaleMinMaxEnabled(true);

        // draw bars behind lines
        mChart.setDrawOrder(new CombinedChart.DrawOrder[]{
                CombinedChart.DrawOrder.BAR
        });

        //图例
        Legend l = mChart.getLegend();
        l.setWordWrapEnabled(true);
        l.setVerticalAlignment(Legend.LegendVerticalAlignment.BOTTOM);
        l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.CENTER);
        l.setOrientation(Legend.LegendOrientation.HORIZONTAL);
        l.setDrawInside(false);


        YAxis rightAxis = mChart.getAxisRight();
        rightAxis.setEnabled(false);
        rightAxis.setAxisMinimum(0f);

        YAxis leftAxis = mChart.getAxisLeft();
        leftAxis.setEnabled(false);
        leftAxis.setAxisMinimum(0f);

        XAxis xAxis = mChart.getXAxis();
        xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
        xAxis.setDrawGridLines(false);
//        xAxis.setAvoidFirstLastClipping(true);
        xAxis.setAxisMinimum(0.5f);
        xAxis.setGranularity(1f);
        xAxis.setValueFormatter(new IAxisValueFormatter() {
            @Override
            public String getFormattedValue(float value, AxisBase axis) {
                if (value % 1 == 0&&value>=1) {
                    return mMonths[(int) value % mMonths.length-1];
                } else {
                    return "";
                }
            }
        });

        CombinedData data = new CombinedData();
        data.setData(generateBarData(1f, 1f));
        xAxis.setAxisMaximum(data.getXMax() + 0.25f);

        mChart.setData(data);
        mChart.setVisibleXRange(3, 5);
        mChart.setExtraOffsets(10, 0, 0, 0);
        mChart.invalidate();

    }
 
开发者ID:xsingHu,项目名称:xs-android-architecture,代码行数:73,代码来源:MainActivity.java

示例4: onCreate

import com.github.mikephil.charting.charts.CombinedChart; //导入方法依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mChart = (CombinedChart) findViewById(R.id.chart1);
        //描述
        mChart.getDescription().setEnabled(false);

        mChart.setBackgroundColor(Color.WHITE);

        mChart.setDrawGridBackground(false);
        mChart.setDrawBarShadow(false);
        mChart.setHighlightFullBarEnabled(false);

        mChart.setScaleEnabled(false);
        mChart.setScaleYEnabled(false);
        mChart.setScaleXEnabled(false);

        mChart.setPinchZoom(false);
//        mChart.setScaleMinima(2f, 1f);
//        mChart.setAutoScaleMinMaxEnabled(true);

        // draw bars behind lines
        mChart.setDrawOrder(new CombinedChart.DrawOrder[]{
                CombinedChart.DrawOrder.BAR
        });

        //图例
        Legend l = mChart.getLegend();
        l.setWordWrapEnabled(true);
        l.setVerticalAlignment(Legend.LegendVerticalAlignment.BOTTOM);
        l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.CENTER);
        l.setOrientation(Legend.LegendOrientation.HORIZONTAL);
        l.setDrawInside(false);


        YAxis rightAxis = mChart.getAxisRight();
        rightAxis.setEnabled(false);
        rightAxis.setAxisMinimum(0f);

        YAxis leftAxis = mChart.getAxisLeft();
        leftAxis.setEnabled(false);
        leftAxis.setAxisMinimum(0f);

        XAxis xAxis = mChart.getXAxis();
        xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
        xAxis.setDrawGridLines(false);
//        xAxis.setAvoidFirstLastClipping(true);
        xAxis.setAxisMinimum(0.5f);
        xAxis.setGranularity(1f);
        xAxis.setValueFormatter(new IAxisValueFormatter() {
            @Override
            public String getFormattedValue(float value, AxisBase axis) {
                if (value % 1 == 0&&value>=1) {
                    return mMonths[(int) value % mMonths.length-1];
                } else {
                    return "";
                }
            }
        });

        CombinedData data = new CombinedData();
        data.setData(generateBarData(1f, 1f));
        xAxis.setAxisMaximum(data.getXMax() + 0.25f);

        mChart.setData(data);
        mChart.setVisibleXRange(4, 6);
        mChart.setExtraOffsets(10, 0, 0, 0);
        mChart.invalidate();

    }
 
开发者ID:xsingHu,项目名称:xs-android-architecture,代码行数:73,代码来源:MainActivity2.java


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