android - How to remove padding from horizontal barchart of mpandroidchart? -


i trying make horizontal barchart covers entire parent layout not. below code -

horizontalbarchart barchart = new horizontalbarchart(activity); barchart.setlayoutparams(new linearlayout.layoutparams(0, 110, weight));  arraylist<barentry> entries = new arraylist<barentry>(); entries.add(new barentry(86.0f, 0));  bardataset dataset = new bardataset(entries, ""); dataset.setcolor(color.parsecolor("#e0e0e0"));  arraylist<string> labels = new arraylist<string>(); labels.add("86.0");   bardata bardata = new bardata(labels, dataset); barchart.setdata(bardata); barchart.setdescription("");  legend legend = barchart.getlegend(); legend.setenabled(false);  yaxis topaxis = barchart.getaxisleft(); topaxis.setdrawlabels(false);  yaxis bottomaxis = barchart.getaxisright(); bottomaxis.setdrawlabels(false);  xaxis rightaxis = barchart.getxaxis(); rightaxis.setdrawlabels(false); bottomaxis.setdrawlabels(false);  barchart.setpadding(-1, -1, -1, -1); barchart.setbackgroundcolor(color.cyan);  return barchart; 

i want horizontal barchart (barchart) fill entire blue area. can please help.

edit : @philippjahoda tried solution, @ first launch shows same way was, when click/touch chart covers entire area. can please tell me why have touch chart make fill entire space.

at first launch looks -

screen shot: enter image description here

after clicking looks -

screen shot2: enter image description here

update latest version of library if have not already. then, remove offsets chart. it's in documentation.

call:

chart.setviewportoffsets(0f, 0f, 0f, 0f); 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -