MPANDROIDCHART: How to draw X label with .setViewP

2019-08-08 14:55发布

问题:

I have a problem with draw X label when my chart has been set setViewPortOffsets on 0, 0, 0, 0. I know what setViewPortOffsets do, But I don't know how to set it to make only the margins disappear on left and right side. Can someone help me please?

PS: Sorry for my bad English.

回答1:

Add following lines to remove axis lines from both sides of chart:

chartView.getAxisLeft().setEnabled(false);
chartView.getAxisRight().setEnabled(false);