【问题标题】:What the best poissible way to handle points in jsxgraph?在 jsxgraph 中处理点的最佳方法是什么?
【发布时间】:2019-10-03 10:57:59
【问题描述】:

我通过计算向量来处理点,然后标记点什么是最好的处理它,这样它就不会重叠; Look at the image for more clarification

【问题讨论】:

    标签: javascript jsxgraph


    【解决方案1】:

    你可以这样做,见https://jsfiddle.net/rLq8pgzo/

    JXG.Options.label.autoPosition = true;
    var pos = function() { return '(' + 
                              this.X().toFixed(1) + 
                              ',' + 
                              this.Y().toFixed(1) + ')'; };
    
    var board = JXG.JSXGraph.initBoard('jxgbox', { 
           boundingbox: [-15, 15, 15, -15], 
           axis: true 
        });
    var p1 = board.create('point', [-10, 2], {name: pos});
    var p2 = board.create('point', [-5, 1], {name: pos});
    var p3 = board.create('point', [-5, 2], {name: pos});
    var p4 = board.create('point', [9, 4], {name: pos});
    

    autoPosition 属性是新的,目前仅在夜间版本中可用。此外,如果标签内容是动态的,一开始似乎有些问题。

    【讨论】:

      猜你喜欢
      • 2015-06-12
      • 1970-01-01
      • 2010-09-06
      • 2011-01-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多