Question

How can I change the label position for a polygon?

p = this.board.create('polygon',[p1,p2,p4,p3],{
  withLines:false,
  withLabel: true,
  name: function () {
    return "lala  " + p1.Dist(p2).toFixed(2) + "m";
  },
  id: p3.X() + "_" + p4.Y()
});
Was it helpful?

Solution

In JSXGraph the polygon label is centered by default. You can supply offset values (in pixel) by label: { offset:[xoff, yoff] }

See http://jsxgraph.uni-bayreuth.de/wiki/index.php/Positioning_of_labels.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top