MpAndroid水平条形图中的额外线条

时间:2017-09-10 02:45:41

标签: android mpandroidchart

如附图所示,我试图使用MPAndroid图书馆的水平条形图,一切正常,但图表末尾有一条垂直线,如图所示。我还附上了图表样式的代码。请有人帮忙纠正我的代码中的错误。

bardataset.setValueTextSize(15);
List<Integer>colors = new ArrayList<>();
colors.add(Color.rgb(220,209,227));
colors.add(Color.rgb(88,130,250));
bardataset.setColors(colors);
tempchart.getDescription().setEnabled(false);
///// disabling chart legend
tempchart.getLegend().setEnabled(false);
tempchart.getAxisLeft().setDrawAxisLine(false);
tempchart.getAxisLeft().setDrawGridLines(false);
tempchart.getXAxis().setDrawGridLines(false);
tempchart.getAxisRight().setDrawAxisLine(false);
tempchart.getAxisRight().setDrawGridLines(false);
tempchart.getDescription().setEnabled(false);   // Hide the description
tempchart.getAxisLeft().setDrawLabels(false);
tempchart.getAxisRight().setDrawLabels(false);
tempchart.getXAxis().setDrawLabels(false);
tempchart.getLegend().setEnabled(false);   // Hide the legend
BarData bardata = new BarData(bardataset);
bardata.setBarWidth(0.20f);
tempchart.setData(bardata);
tempchart.invalidate();

MpChart错误的图片:

Image for MpChart Error

1 个答案:

答案 0 :(得分:1)

将此行添加到您的代码

tempchart.getXAxis().setDrawAxisLine(false);