Plot data with slider: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
<jsxgraph width="600" height=" | <jsxgraph width="600" height="250" box="box1"> | ||
var plotData = [ | var plotData = [ | ||
[0, 1, 2, 3, 4, 5, 6, 7], | [0, 1, 2, 3, 4, 5, 6, 7], | ||
Line 5: | Line 5: | ||
]; | ]; | ||
var | var brd1 = JXG.JSXGraph.initBoard('box1', {boundingbox:[0,50,8,-50], axis:true, keepaspectratio:false}); | ||
var mu = | var mu = brd1.create('slider', [[2.5,30], [5,30], [0, 1, 1]], {name:'μ'}); | ||
var plot = | var plot = brd1.create('curve', plotData, {type:'plot'}); | ||
plot.updateDataArray = function() { | plot.updateDataArray = function() { | ||
Line 18: | Line 18: | ||
} | } | ||
}; | }; | ||
</jsxgraph> | |||
<jsxgraph width="600" height="250" box="box2"> | |||
var brd2 = JXG.JSXGraph.initBoard('box2', {boundingbox:[0,50,1,-1], axis:true, | |||
keepaspectratio:false}); | |||
var p = brd2.create('point', [ function() { return mu.Value();}, function() { return 1; }]); | |||
</jsxgraph> | </jsxgraph> | ||