PhilJay / MPAndroidChart

A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.
Other
37.63k stars 9.02k forks source link

No Y-axis dashed line is displayed #4526

Open songzhonghua opened 5 years ago

songzhonghua commented 5 years ago

hi,Thank you for your library But I found that the y-axis dashed line property didn't work, as was the case with many mobile phones. Device: [e.g. Google Pixel] Android Version [. 8.0] Library Version (3.1.0)

The dotted line of the x-axis is normal, and the y-axis is still shown as a solid line. my code: mLineChart.setHardwareAccelerationEnabled(false); mLineChart.getAxisRight().setEnabled(false); mLineChart.setHighlightPerDragEnabled(false);

    XAxis xAxis = mLineChart.getXAxis();
    xAxis.setAxisMaximum(100f);
    xAxis.setAxisMinimum(0f);
    xAxis.setTextColor(white);
    xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
    xAxis.setDrawGridLines(false);
    xAxis.enableAxisLineDashedLine(10f, 10f, 0);

    LimitLine ll1 = new LimitLine(150f, "");
    ll1.enableDashedLine(10f, 10f, 0f);
    ll1.setLabelPosition(LimitLine.LimitLabelPosition.RIGHT_BOTTOM);
    ll1.setLineColor(white);
    ll1.setLineWidth(2);

    YAxis leftAxis = mLineChart.getAxisLeft();
    leftAxis.removeAllLimitLines();
    leftAxis.addLimitLine(ll1);
    leftAxis.setTextColor(white);
    leftAxis.setDrawGridLines(false);
    leftAxis.enableAxisLineDashedLine(10f, 10f, 0);
    leftAxis.setGranularity(0.25f);

    leftAxis.setDrawLimitLinesBehindData(true);

Thank you for your answer.

songzhonghua commented 5 years ago

xAxis.enableAxisLineDashedLine(10f, 10f, 0);//it works leftAxis.enableAxisLineDashedLine(10f, 10f, 0);//It didn't work.

songzhonghua commented 5 years ago

Please help,thans very much ☺

tsshenhua commented 4 years ago

一样的问题,请问你怎么解决的

tsshenhua commented 4 years ago

@songzhonghua