Difference between revisions of "Bounding box"

From JSXGraph Wiki
Jump to navigationJump to search
Line 1: Line 1:
 +
We can supply a bounding box to specify the dimensions of the drawing panel.
 +
The JavaScript code
 +
<source lang="javascript">
 +
var board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-5,10,5,-2], axis:true});
 +
</source>
 +
sets the vertical and horizontal units and the position of the origin such that
 +
the upper left corner of the drawing panel has position ''(-5,10)'' and the lower right
 +
corner of the drawing panel has position ''(5,2)''.
 
<html>
 
<html>
 
<link rel="stylesheet" type="text/css" href="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css" />
 
<link rel="stylesheet" type="text/css" href="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css" />
Line 5: Line 13:
 
<div id="jxgbox" class="jxgbox" style="width:500px; height:500px;"></div>
 
<div id="jxgbox" class="jxgbox" style="width:500px; height:500px;"></div>
 
<script type="text/javascript">
 
<script type="text/javascript">
var board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-5,10,5,-2], axis:true});
+
var board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-5,10,5,-2], axis:true});
 
</script>
 
</script>
 
</html>
 
</html>
  
 
[[Category:Examples]]
 
[[Category:Examples]]

Revision as of 00:00, 24 June 2009

We can supply a bounding box to specify the dimensions of the drawing panel. The JavaScript code

var board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-5,10,5,-2], axis:true});

sets the vertical and horizontal units and the position of the origin such that the upper left corner of the drawing panel has position (-5,10) and the lower right corner of the drawing panel has position (5,2).