Androidplot get Y Position of Line

23 views
Skip to first unread message

Franzi

unread,
May 11, 2018, 4:55:44 AM5/11/18
to Androidplot

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);



Link to my Question on Stackoverflow

https://stackoverflow.com/questions/50288411/androidplot-get-position-of-line

Nick

unread,
Jun 7, 2018, 7:59:14 AM6/7/18
to Androidplot
Answered in SOF post :-)
Reply all
Reply to author
Forward
0 new messages