adjust distance of an angle label?

13 views
Skip to first unread message

appeo...@gmail.com

unread,
May 26, 2021, 8:22:42 AM5/26/21
to JSXGraph
Hey, is it possible to change the distance that a label has in relation to the angle besides the offset option, which don't play well if the angle changes.

Thanks, 
Andreas

Alfred Wassermann

unread,
May 28, 2021, 7:21:26 AM5/28/21
to JSXGraph
I can see two possibilities:
  • overwrite the method angle.getLabelAnchor() which returns a JXG.Coords element
  • Apply the moveTo() method once. This is a dirty hack, but it seems to work, see https://jsfiddle.net/m7r6o2jk/2/
var a = board.create('point', [0,0]);
var b = board.create('point', [3,0]);
var c = board.create('point', [1,3]);

var angle = board.create('angle', [b, a, c], {name: 'α', radius:1});
angle.label.moveTo([2,2]);

Best wishes,
Alfred




appeo...@gmail.com

unread,
May 30, 2021, 12:03:07 PM5/30/21
to JSXGraph
Ok, thank you. I'll experiment with those options.

Andreas
Reply all
Reply to author
Forward
0 new messages