I have the next chart:
Is there any way to do word wrap for label description ? I was trying to add '\n' symbol but it's not working for me.
I have the next chart:
Is there any way to do word wrap for label description ? I was trying to add '\n' symbol but it's not working for me.
Maybe try a custom XAxisValueFormatter:
public class MyCustomXAxisValueFormatter implements XAxisValueFormatter {
@Override
public String getXValue(String original, int index, ViewPortHandler viewPortHandler) {
if(original.length() > 10)
{
original = original.substring(0, 6) + "\n" + original.substring(6, original.length());
}
return ...;
}
}
Then apply it to your X-axis:
XAxis xAxis = chart.getXAxis();
xAxis.setValueFormatter(new MyCustomXAxisValueFormatter());