android - MPAndroidChart RadarChart collapses itself -


i have problems radarchart labels. specifically, if use long texts (e.g. 15-20 chars), , available space not big, chart gets collapsed , labels positioned inside collapsed chart (but there more space available).

i tried use valueformatter label axis truncates labels if longer 5 chars, see, chart size calculaction based on full label text, chart got collapsed same way described before.

xaxis xaxis = radarchart.getxaxis(); xaxis.setvalueformatter(new xaxisvalueformatter() {     @override     public string getxvalue(string original, int index, viewporthandler viewporthandler) {         return original.length() > 5 ? original.substring(0, 5) + "…" : original;     } }); 

here pictures clarify problem. charts displayed inside cardviews , can see, there plenty of space remaining on sides. first 2 pictures taken valueformatter set, last 2 without it.

description

description

description

description

probably having mistakes, here solutions:

1) set radar data after set radarchart parameters call invalidate();

2) set axisminimum , axismaximum in radarchart.getxaxis() , radarchart.getyaxis()

3) call yaxis.calculate(min,max) after step 2;

4) if needed use radarchart.setextraoffsets(?,?,?,?)

i using com.github.philjay:mpandroidchart:v3.0.1


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -