Highlight curve via slider: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 3: | Line 3: | ||
var s = board.createElement('slider', [[1,8],[5,8],[0,0,1]]); | var s = board.createElement('slider', [[1,8],[5,8],[0,0,1]]); | ||
var g = board.createElement('functiongraph', [function(x){ return x*x;}] | var g = board.createElement('functiongraph', [function(x){ return x*x;}], | ||
{ | { | ||
strokeColor:function(){ return (s.Value()<0.5)?'red':'blue';} | strokeColor:function(){ return (s.Value()<0.5)?'red':'blue';} | ||
}); | }); | ||
var f = board.createElement('functiongraph', [function(x){ return x+1;}] | var f = board.createElement('functiongraph', [function(x){ return x+1;}], | ||
{ | { | ||
strokeColor:function(){ return (s.Value()>=0.5)?'red':'blue';} | strokeColor:function(){ return (s.Value()>=0.5)?'red':'blue';} | ||
}); | }); | ||
</jsxgraph> | </jsxgraph> |