模板:JSXGraph1

来自活字社
跳到导航 跳到搜索

用法

在页面中插入代码 {{JSXGraph1}} <html></html> 包裹图表代码:

绘图区域 <div id="jxgbox" class="jxgbox" style="width:500px; height:400px;"></div>
<script></script> 包裹 javascript 代码绘图:
定义绘画板 var board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-5, 7, 5, -1], keepAspectRatio:true, axis:true}); ,其中 boundingbox: [-5, 7, 5, -1] 定义坐标系范围 [左x, 上y, 右x, 下y];keepAspectRatio:true 保持纵横比;axis:true 显示坐标图。
画点 var t = board.create('point',[4,6]);
画点 var p = board.create('point',[-2,-1],{name:"first", size:5, color:"FF0000"});

效果