# Difference between revisions of "Number line"

From JSXGraph Wiki

Jump to navigationJump to searchA WASSERMANN (talk | contribs) |
A WASSERMANN (talk | contribs) |
||

(4 intermediate revisions by the same user not shown) | |||

Line 1: | Line 1: | ||

<jsxgraph width="400" height="300"> | <jsxgraph width="400" height="300"> | ||

− | var brd = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-5,2,5,-2]}); | + | var brd = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-5.2,2,5.2,-2]}); |

var axisx = brd.create('axis', [[0,0], [1,0]], | var axisx = brd.create('axis', [[0,0], [1,0]], | ||

{ | { | ||

Line 8: | Line 8: | ||

drawZero: true, | drawZero: true, | ||

ticksDistance: 1, | ticksDistance: 1, | ||

− | majorHeight: | + | majorHeight: 30, |

tickEndings: [1,1], | tickEndings: [1,1], | ||

− | minorTicks: | + | minorTicks: 0 |

} | } | ||

}); | }); | ||

+ | var p = brd.create('glider', [2.2, 0, axisx], {}); | ||

</jsxgraph> | </jsxgraph> | ||

===The underlying JavaScript code=== | ===The underlying JavaScript code=== | ||

<source lang="javascript"> | <source lang="javascript"> | ||

− | + | var brd = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-5.2,2,5.2,-2]}); | |

+ | var axisx = brd.create('axis', [[0,0], [1,0]], | ||

+ | { | ||

+ | firstArrow: true, | ||

+ | lastArrow: true, | ||

+ | ticks: { | ||

+ | drawZero: true, | ||

+ | ticksDistance: 1, | ||

+ | majorHeight: 30, | ||

+ | tickEndings: [1,1], | ||

+ | minorTicks: 0 | ||

+ | } | ||

+ | }); | ||

+ | var p = brd.create('glider', [2.2, 0, axisx], {}); | ||

</source> | </source> | ||

[[Category:Examples]] | [[Category:Examples]] |

## Latest revision as of 11:45, 10 July 2013

### The underlying JavaScript code

```
var brd = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-5.2,2,5.2,-2]});
var axisx = brd.create('axis', [[0,0], [1,0]],
{
firstArrow: true,
lastArrow: true,
ticks: {
drawZero: true,
ticksDistance: 1,
majorHeight: 30,
tickEndings: [1,1],
minorTicks: 0
}
});
var p = brd.create('glider', [2.2, 0, axisx], {});
```