mpandroidchart - How can I avoid the repeated values in Y-Axis?

前端 未结 6 518
情话喂你
情话喂你 2020-12-10 01:31

I want to avoid the repeated values and the -0 values in Y-Axis, avoiding the image situation.

I have these ideas to solve this, but any solution:

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-10 02:01

    code like this:

        mchart.setAutoScaleMinMaxEnabled(false);
        mchart.getAxisLeft().setAxisMaxValue(10);
        mchart.getAxisLeft().setAxisMinValue(5);
        mchart.getAxisRight().setAxisMaxValue(10);
        mchart.getAxisRight().setAxisMinValue(5);
    

    or:

    boolean a = isReady;
     mchart.getAxisLeft().setFormater(new format(float b){ return "" ;})
    

    When u get data :

        mchart.setAutoScaleMinMaxEnabled(true);
        mchart.getAxisLeft().resetAxisMaxValue();
        mchart.getAxisLeft().resetAxisMinValue();
        mchart.getAxisRight().resetAxisMaxValue();
        mchart.getAxisRight().resetAxisMinValue(5);
    

    I have no code by my hand.

提交回复
热议问题