Avneesh Kumar
Avneesh Kumar

Reputation: 53

Extra Line in MpAndroid Horizontal Bar chart

As shown in the image attached with the post I am trying to use Horizontal Barchart of MPAndroid libraray and everything works fine except there is a verticle line at the end of the chart as shown in the figure. I am also attaching the code of styling of the chart. can someone please help to rectify the error in my code.

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();

Image for MpChart Error:

Image for MpChart Error

Upvotes: 0

Views: 375

Answers (1)

sauvik
sauvik

Reputation: 2254

add this line to your code

tempchart.getXAxis().setDrawAxisLine(false);

Upvotes: 1

Related Questions