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


Java XAxis.setDrawLimitLinesBehindData方法代碼示例

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


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

示例1: setupActivityChart

import com.github.mikephil.charting.components.XAxis; //導入方法依賴的package包/類
private void setupActivityChart() {
        mActivityChart.setBackgroundColor(BACKGROUND_COLOR);
        mActivityChart.setDescriptionColor(DESCRIPTION_COLOR);
        configureBarLineChartDefaults(mActivityChart);

        XAxis x = mActivityChart.getXAxis();
        x.setDrawLabels(true);
        x.setDrawGridLines(false);
        x.setEnabled(true);
        x.setTextColor(CHART_TEXT_COLOR);
        x.setDrawLimitLinesBehindData(true);

        YAxis y = mActivityChart.getAxisLeft();
        y.setDrawGridLines(false);
//        y.setDrawLabels(false);
        // TODO: make fixed max value optional
        y.setAxisMaxValue(1f);
        y.setAxisMinValue(0);
        y.setDrawTopYLabelEntry(false);
        y.setTextColor(CHART_TEXT_COLOR);

//        y.setLabelCount(5);
        y.setEnabled(true);

        YAxis yAxisRight = mActivityChart.getAxisRight();
        yAxisRight.setDrawGridLines(false);
        yAxisRight.setEnabled(supportsHeartrate(getChartsHost().getDevice()));
        yAxisRight.setDrawLabels(true);
        yAxisRight.setDrawTopYLabelEntry(true);
        yAxisRight.setTextColor(CHART_TEXT_COLOR);
        yAxisRight.setAxisMaxValue(HeartRateUtils.MAX_HEART_RATE_VALUE);
        yAxisRight.setAxisMinValue(HeartRateUtils.MIN_HEART_RATE_VALUE);
    }
 
開發者ID:scifiswapnil,項目名稱:gadgetbridge_artikcloud,代碼行數:34,代碼來源:SleepChartFragment.java

示例2: setupWeekStepsChart

import com.github.mikephil.charting.components.XAxis; //導入方法依賴的package包/類
private void setupWeekStepsChart() {
    mWeekStepsChart.setBackgroundColor(BACKGROUND_COLOR);
    mWeekStepsChart.setDescriptionColor(DESCRIPTION_COLOR);
    mWeekStepsChart.setDescription("");

    configureBarLineChartDefaults(mWeekStepsChart);

    XAxis x = mWeekStepsChart.getXAxis();
    x.setDrawLabels(true);
    x.setDrawGridLines(false);
    x.setEnabled(true);
    x.setTextColor(CHART_TEXT_COLOR);
    x.setDrawLimitLinesBehindData(true);

    YAxis y = mWeekStepsChart.getAxisLeft();
    y.setDrawGridLines(false);
    y.setDrawTopYLabelEntry(false);
    y.setTextColor(CHART_TEXT_COLOR);

    y.setEnabled(true);

    YAxis yAxisRight = mWeekStepsChart.getAxisRight();
    yAxisRight.setDrawGridLines(false);
    yAxisRight.setEnabled(false);
    yAxisRight.setDrawLabels(false);
    yAxisRight.setDrawTopYLabelEntry(false);
    yAxisRight.setTextColor(CHART_TEXT_COLOR);
}
 
開發者ID:scifiswapnil,項目名稱:gadgetbridge_artikcloud,代碼行數:29,代碼來源:WeekStepsChartFragment.java

示例3: setupChart

import com.github.mikephil.charting.components.XAxis; //導入方法依賴的package包/類
private void setupChart() {
        mChart.setBackgroundColor(BACKGROUND_COLOR);
        mChart.setDescriptionColor(DESCRIPTION_COLOR);
        configureBarLineChartDefaults(mChart);


        XAxis x = mChart.getXAxis();
        x.setDrawLabels(true);
        x.setDrawGridLines(false);
        x.setEnabled(true);
        x.setTextColor(CHART_TEXT_COLOR);
        x.setDrawLimitLinesBehindData(true);

        YAxis y = mChart.getAxisLeft();
        y.setDrawGridLines(false);
//        y.setDrawLabels(false);
        // TODO: make fixed max value optional
        y.setAxisMaxValue(1f);
        y.setAxisMinValue(0);
        y.setDrawTopYLabelEntry(false);
        y.setTextColor(CHART_TEXT_COLOR);

//        y.setLabelCount(5);
        y.setEnabled(true);

        YAxis yAxisRight = mChart.getAxisRight();
        yAxisRight.setDrawGridLines(false);
        yAxisRight.setEnabled(supportsHeartrate(getChartsHost().getDevice()));
        yAxisRight.setDrawLabels(true);
        yAxisRight.setDrawTopYLabelEntry(true);
        yAxisRight.setTextColor(CHART_TEXT_COLOR);
        yAxisRight.setAxisMaxValue(HeartRateUtils.MAX_HEART_RATE_VALUE);
        yAxisRight.setAxisMinValue(HeartRateUtils.MIN_HEART_RATE_VALUE);

        // refresh immediately instead of use refreshIfVisible(), for perceived performance
        refresh();
    }
 
開發者ID:scifiswapnil,項目名稱:gadgetbridge_artikcloud,代碼行數:38,代碼來源:ActivitySleepChartFragment.java

示例4: initChart

import com.github.mikephil.charting.components.XAxis; //導入方法依賴的package包/類
private void initChart(BarChart chart) {
    float scaledDensity = getResources().getDisplayMetrics().scaledDensity;
    chart.setDragEnabled(true);
    chart.setScaleYEnabled(false);
    chart.setScaleXEnabled(false);
    chart.setDoubleTapToZoomEnabled(false);
    chart.setPinchZoom(false);
    chart.setHighlightPerDragEnabled(false);
    chart.setHighlightPerTapEnabled(false);

    chart.setDrawGridBackground(false);
    chart.setDrawBorders(false);
    chart.setDrawValueAboveBar(false);
    chart.getAxisLeft().setEnabled(false);
    XAxis xAxis = chart.getXAxis();
    xAxis.setDrawAxisLine(true);
    xAxis.setDrawGridLines(false);
    xAxis.setDrawLabels(false);
    xAxis.setDrawLimitLinesBehindData(false);
    xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);

    YAxis yAxis = chart.getAxisRight();
    yAxis.setDrawAxisLine(false);
    yAxis.setStartAtZero(false);
    yAxis.setSpaceTop(10f);
    yAxis.setSpaceBottom(0f);
    yAxis.setTextSize(10 * scaledDensity);
    yAxis.setTextColor(ContextCompat.getColor(this, R.color.text));
    chart.getLegend().setEnabled(false);
    chart.setDescription(" ");

    chart.setNoDataText("Can't see sh*t captain!");
    Paint p = chart.getPaint(Chart.PAINT_INFO);
    DisplayMetrics dm = getResources().getDisplayMetrics();
    int size = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 18, dm); //TODO use styles
    p.setTextSize(size);
    p.setColor(ContextCompat.getColor(this, R.color.gray600));
    p.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
}
 
開發者ID:stanleyguevara,項目名稱:beaconradar,代碼行數:40,代碼來源:DetailsActivity.java

示例5: onCreateView

import com.github.mikephil.charting.components.XAxis; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {

    view = inflater.inflate(R.layout.fragment_lastscanchart, container, false);

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

    cv_LastScan.setOnChartGestureListener(new myChartGestureListener(cv_LastScan));

    XAxis xAxis = cv_LastScan.getXAxis();
    xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
    xAxis.setTextSize(10f);
    xAxis.setTextColor(getResources().getColor(R.color.colorGlucoseNow));
    xAxis.enableGridDashedLine(5f, 5f, 0f);
    xAxis.setDrawLimitLinesBehindData(true);

    YAxis yAxisLeft = cv_LastScan.getAxisLeft();
    YAxis yAxisRight = cv_LastScan.getAxisRight();

    yAxisRight.setEnabled(false);

    yAxisLeft.setTextSize(18f); // set the textsize
    yAxisLeft.setTextColor(getResources().getColor(R.color.colorGlucoseNow));
    yAxisLeft.setPosition(YAxis.YAxisLabelPosition.INSIDE_CHART);
    yAxisLeft.setStartAtZero(true);
    yAxisLeft.setYOffset(-6f);
    yAxisLeft.setAxisMinValue(0.0f);

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

    // no description text
    cv_LastScan.setDescription("");
    cv_LastScan.setNoDataText(getResources().getString(R.string.no_data));
    cv_LastScan.setNoDataTextDescription("");

    // enable touch gestures
    cv_LastScan.setTouchEnabled(true);

    // enable scaling and dragging
    cv_LastScan.setDragEnabled(true);
    cv_LastScan.setScaleEnabled(true);
    cv_LastScan.setDrawGridBackground(false);

    // if disabled, scaling can be done on x- and y-axis separately
    cv_LastScan.setPinchZoom(true);


    MyMarkerView mv = new MyMarkerView(view.getContext(), R.layout.custom_marker_view);

    // set the marker to the chart
    cv_LastScan.setMarkerView(mv);

    try {
        int sdk = android.os.Build.VERSION.SDK_INT;
        if (sdk < android.os.Build.VERSION_CODES.HONEYCOMB) {
            cv_LastScan.setHardwareAccelerationEnabled(false);

        } else {
           cv_LastScan.setHardwareAccelerationEnabled(true);
        }
    } catch (Exception e) {
    }

    refresh();

    return (view);
}
 
開發者ID:CMKlug,項目名稱:Liapp,代碼行數:70,代碼來源:ChartFragment.java

示例6: initChart

import com.github.mikephil.charting.components.XAxis; //導入方法依賴的package包/類
public void initChart() {
    mChart.setDescription("");
    mChart.setDragEnabled(false);
    mChart.setScaleEnabled(false);
    mChart.setPinchZoom(false);

    GraphMarkerView markerView = new GraphMarkerView(mChart.getContext(), R.layout.trackdota_graph_marker);
    mChart.setMarkerView(markerView);
    mChart.setHighlightEnabled(false);

    XAxis xAxis = mChart.getXAxis();
    xAxis.removeAllLimitLines();
    xAxis.setDrawLimitLinesBehindData(true);
    xAxis.setDrawGridLines(true);

    YAxis leftAxis = mChart.getAxisLeft();
    leftAxis.removeAllLimitLines();
    leftAxis.setStartAtZero(false);

    LimitLine limitLine = new LimitLine(0f);
    limitLine.setLineColor(Color.WHITE);
    limitLine.setLineWidth(2f);
    leftAxis.addLimitLine(limitLine);

    mChart.setBackgroundColor(Color.BLACK);
    mChart.setDrawBorders(false);
    mChart.getLegend().setEnabled(false);
    mChart.setDoubleTapToZoomEnabled(false);
    mChart.setDrawGridBackground(false);

    leftAxis.setValueFormatter(new ValueFormatter() {
        @Override
        public String getFormattedValue(float value) {
            return String.valueOf((int) value);
        }
    });

    leftAxis.setTextColor(Color.WHITE);

    mChart.getAxisRight().setEnabled(false);
    //mChart.animateX(2500);
    clearChart();
}
 
開發者ID:mrprona92,項目名稱:SecretBrand,代碼行數:44,代碼來源:Graphs.java

示例7: setupHistoryChart

import com.github.mikephil.charting.components.XAxis; //導入方法依賴的package包/類
private void setupHistoryChart(BarLineChartBase chart) {
    configureBarLineChartDefaults(chart);

    chart.setTouchEnabled(false); // no zooming or anything, because it's updated all the time
    chart.setBackgroundColor(BACKGROUND_COLOR);
    chart.setDescriptionColor(DESCRIPTION_COLOR);
    chart.setDescription(getString(R.string.live_activity_steps_per_minute_history));
    chart.setNoDataText(getString(R.string.live_activity_start_your_activity));
    chart.getLegend().setEnabled(false);
    Paint infoPaint = chart.getPaint(Chart.PAINT_INFO);
    infoPaint.setTextSize(Utils.convertDpToPixel(20f));
    infoPaint.setFakeBoldText(true);
    chart.setPaint(infoPaint, Chart.PAINT_INFO);

    XAxis x = chart.getXAxis();
    x.setDrawLabels(true);
    x.setDrawGridLines(false);
    x.setEnabled(true);
    x.setTextColor(CHART_TEXT_COLOR);
    x.setDrawLimitLinesBehindData(true);

    YAxis y = chart.getAxisLeft();
    y.setDrawGridLines(false);
    y.setDrawTopYLabelEntry(false);
    y.setTextColor(CHART_TEXT_COLOR);
    y.setEnabled(true);
    y.setAxisMinValue(0);

    YAxis yAxisRight = chart.getAxisRight();
    yAxisRight.setDrawGridLines(false);
    yAxisRight.setEnabled(true);
    yAxisRight.setDrawLabels(true);
    yAxisRight.setDrawTopYLabelEntry(false);
    yAxisRight.setTextColor(CHART_TEXT_COLOR);
    yAxisRight.setAxisMaxValue(HeartRateUtils.MAX_HEART_RATE_VALUE);
    yAxisRight.setAxisMinValue(HeartRateUtils.MIN_HEART_RATE_VALUE);

    mHistorySet = new LineDataSet(new ArrayList<Entry>(), getString(R.string.live_activity_steps_history));
    mHistorySet.setAxisDependency(YAxis.AxisDependency.LEFT);
    mHistorySet.setColor(akActivity.color);
    mHistorySet.setDrawCircles(false);
    mHistorySet.setDrawCubic(true);
    mHistorySet.setDrawFilled(true);
    mHistorySet.setDrawValues(false);

    mHeartRateSet = createHeartrateSet(new ArrayList<Entry>(), getString(R.string.live_activity_heart_rate));
    mHeartRateSet.setDrawValues(false);
}
 
開發者ID:scifiswapnil,項目名稱:gadgetbridge_artikcloud,代碼行數:49,代碼來源:LiveActivityFragment.java


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