當前位置: 首頁>>代碼示例>>Java>>正文


Java YAxis.setDrawLimitLinesBehindData方法代碼示例

本文整理匯總了Java中com.github.mikephil.charting.components.YAxis.setDrawLimitLinesBehindData方法的典型用法代碼示例。如果您正苦於以下問題:Java YAxis.setDrawLimitLinesBehindData方法的具體用法?Java YAxis.setDrawLimitLinesBehindData怎麽用?Java YAxis.setDrawLimitLinesBehindData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.github.mikephil.charting.components.YAxis的用法示例。


在下文中一共展示了YAxis.setDrawLimitLinesBehindData方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initChart

import com.github.mikephil.charting.components.YAxis; //導入方法依賴的package包/類
/**
 * Initialize the non-data aspects of the line chart
 */
private void initChart(){

    //Initial line Chart for visualization of statistic
    lineChart = (LineChart) findViewById(R.id.LineChart);
    lineChart.setDragEnabled(true);
    lineChart.setScaleEnabled(false);
    lineChart.getAxisRight().setEnabled(false);
    lineChart.getDescription().setEnabled(false);

    YAxis leftAxis = lineChart.getAxisLeft();
    leftAxis.removeAllLimitLines();
    leftAxis.setAxisMaximum(100f);
    leftAxis.setAxisMinimum(0.0f);
    leftAxis.enableGridDashedLine(10f, 10f, 0f);
    leftAxis.setDrawLimitLinesBehindData(true);
}
 
開發者ID:CMPUT301F17T15,項目名稱:CIA,代碼行數:20,代碼來源:SingleStatisticViewActivity.java

示例2: init

import com.github.mikephil.charting.components.YAxis; //導入方法依賴的package包/類
private void init(Context context, AttributeSet attrs, int defStyle) {
        getDescription().setEnabled(false);
        LimitLine llXAxis = new LimitLine(10f, "Index 10");
        llXAxis.setLineWidth(4f);
        llXAxis.enableDashedLine(10f, 10f, 0f);
        llXAxis.setLabelPosition(LimitLine.LimitLabelPosition.RIGHT_BOTTOM);
        llXAxis.setTextSize(10f);

        XAxis xAxis = getXAxis();
//        xAxis.enableGridDashedLine(10f, 10f, 0f);
        xAxis.setDrawGridLines(false);
        xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
        xAxis.setTextColor(Color.GRAY);

        LimitLine ll1 = new LimitLine(80f, "Avg");
        ll1.setLineWidth(1f);
        ll1.enableDashedLine(10f, 10f, 0f);
        ll1.setLabelPosition(LimitLine.LimitLabelPosition.RIGHT_TOP);
        ll1.setTextSize(10f);

        YAxis leftAxis = getAxisLeft();
        leftAxis.removeAllLimitLines();
        leftAxis.addLimitLine(ll1);
        leftAxis.setAxisMaximum(160f);
        leftAxis.setAxisMinimum(0f);
        leftAxis.setDrawGridLines(false);
        leftAxis.setDrawZeroLine(false);
        leftAxis.setTextColor(Color.GRAY);

        leftAxis.setDrawLimitLinesBehindData(true);

        getAxisRight().setEnabled(false);

        Legend l = getLegend();
        l.setForm(Legend.LegendForm.LINE);
    }
 
開發者ID:VidyaSastry,項目名稱:Opal-Chat-AnalyticsDashboard,代碼行數:37,代碼來源:MyLineChart.java

示例3: updateLastScanChart

import com.github.mikephil.charting.components.YAxis; //導入方法依賴的package包/類
public void updateLastScanChart() {

        SharedPreferences sharedPrefs = PreferenceManager
                .getDefaultSharedPreferences(this.getApplicationContext());

        ImageView iv_unit;
        iv_unit = (ImageView)findViewById(R.id.iv_unit);


        if(sharedPrefs.getString("pref_unit", "mg/dl").equals("mg/dl")) {
            iv_unit.setImageResource(R.drawable.unit_mgdl);
        }else{
            iv_unit.setImageResource(R.drawable.unit_mmoll);
        }

        LineChart cv_LastScan = (LineChart) findViewById(R.id.cv_LastScan);

        if(sharedPrefs.getBoolean("pref_nightmode", false)) {
            cv_LastScan.setBackgroundColor(getResources().getColor(R.color.colorBackgroundDark));
        }else{
            cv_LastScan.setBackgroundColor(getResources().getColor(R.color.colorBackgroundLight));
        }

        LineData getData = cv_LastScan.getData();
        if(getData != null) {
            YAxis yAxisLeft = cv_LastScan.getAxisLeft();

            yAxisLeft.removeAllLimitLines();
            yAxisLeft.setDrawLimitLinesBehindData(true);
            yAxisLeft.resetAxisMaxValue();

            if (cv_LastScan.getData() != null && !sharedPrefs.getString("pref_default_range", "0.0").equals("")) {
                if (cv_LastScan.getData().getDataSets().get(0).getYMax() < Float.valueOf(sharedPrefs.getString("pref_default_range", "0.0"))) { //Todo: platz für highlight
                    yAxisLeft.setAxisMaxValue(Float.valueOf(sharedPrefs.getString("pref_default_range", "0.0")));
                }
            }

            LimitLine ll_max = new LimitLine(Float.valueOf(sharedPrefs.getString("pref_zb_max", "-100.0")), getResources().getString(R.string.pref_zb_max));
            ll_max.setLineWidth(4f);
            ll_max.setTextSize(12f);

            LimitLine ll_min = new LimitLine(Float.valueOf(sharedPrefs.getString("pref_zb_min", "-100.0")), getResources().getString(R.string.pref_zb_min));
            ll_min.setLineWidth(4f);
            ll_min.setTextSize(12f);

            ll_min.setLabelPosition(LimitLine.LimitLabelPosition.RIGHT_BOTTOM);

            Legend legend = cv_LastScan.getLegend();
            legend.setEnabled(false);

            // set an alternative background color
            if (sharedPrefs.getBoolean("pref_nightmode", false)) {
                ll_max.setLineColor(getResources().getColor(R.color.colorZielbereichDark));
                ll_max.setTextColor(getResources().getColor(R.color.colorZielbereichDark));

                ll_min.setLineColor(getResources().getColor(R.color.colorZielbereichDark));
                ll_min.setTextColor(getResources().getColor(R.color.colorZielbereichDark));
            } else {
                ll_max.setLineColor(getResources().getColor(R.color.colorZielbereichLight));
                ll_max.setTextColor(getResources().getColor(R.color.colorZielbereichLight));

                ll_min.setLineColor(getResources().getColor(R.color.colorZielbereichLight));
                ll_min.setTextColor(getResources().getColor(R.color.colorZielbereichLight));
            }

            yAxisLeft.addLimitLine(ll_max);
            yAxisLeft.addLimitLine(ll_min);

            cv_LastScan.notifyDataSetChanged();
            cv_LastScan.invalidate();
        }

    }
 
開發者ID:CMKlug,項目名稱:Liapp,代碼行數:74,代碼來源:MainActivity.java


注:本文中的com.github.mikephil.charting.components.YAxis.setDrawLimitLinesBehindData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。