答案 0 :(得分:1)
也许尝试自定义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 ...;
}
}
然后将其应用到您的X轴:
XAxis xAxis = chart.getXAxis();
xAxis.setValueFormatter(new MyCustomXAxisValueFormatter());