There's not a built in second axis caption, but since they're just instances of TextLabelWidget
its pretty easy to add your own. Here's an example that adds a label to the SimpleXYPlotActivity
example
TextLabelWidget textLabelWidget = new TextLabelWidget(
plot.getLayoutManager(),
"some text",
null, // TextLabelWidget instances "pack" to wrap the actual text size
TextOrientation.VERTICAL_ASCENDING);
textLabelWidget.getLabelPaint().setColor(Color.RED);
textLabelWidget.getLabelPaint().setTextSize(PixelUtils.dpToPix(24));
plot.getLayoutManager().add(textLabelWidget);
textLabelWidget.position(
// add a right margin of 4dp:
PixelUtils.dpToPix(4), HorizontalPositioning.ABSOLUTE_FROM_RIGHT,
// center the text with the plot space vertically:
0, VerticalPositioning.ABSOLUTE_FROM_CENTER,
// use the middle of the right edge of the text widget as the anchor:
Anchor.RIGHT_MIDDLE);
Which produces:
