I would like to place anTextLabelWidget
above a specific line in android Plot.
Is there any way to connect it directly to a line or to calculate the exact Y-position of a line.
Get the correct position of a point in AndroidPlot
https://stackoverflow.com/posts/comments/87452134?noredirect=1
That's my Code so far:
TextLabelWidget txtText = new TextLabelWidget(
rdPuls.getLayoutManager(),
"Some Text",
null, // TextLabelWidget instances "pack" to wrap the actual text size
TextOrientation.HORIZONTAL);
txtText.getLabelPaint().setColor(getColor(R.color.biosign_green));
txtText.getLabelPaint().setTextSize(PixelUtils.dpToPix(15));
txtText.position(
// add a right margin of 4dp:
0, PixelUtils.dpToPix(80)
// center the text with the plot space vertically:
PixelUtils.dpToPix(80), VerticalPositioning.ABSOLUTE_FROM_BOTTOM,
// use the middle of the right edge of the text widget as the anchor:
Anchor.RIGHT_MIDDLE);