I am trying to show X axis label to go to 2 lines when they are long. How to achieve this in LineChart? See screenshot below. I want time to go to second line instead of sta
No need to offset x coordinate. And for multi-line scenario the code should be
@Override
protected void drawLabel(Canvas c, String formattedLabel, float x, float y, MPPointF anchor, float angleDegrees) {
String lines[] = formattedLabel.split("\n");
for (int i = 0; i < lines.length; i++) {
float vOffset = i * mAxisLabelPaint.getTextSize();
Utils.drawXAxisValue(c, lines[i], x, y + vOffset, mAxisLabelPaint, anchor, angleDegrees);
}
}