Difference between revisions of "Google style chart - interactive"
From JSXGraph Wiki
Jump to navigationJump to searchA WASSERMANN (talk | contribs) |
A WASSERMANN (talk | contribs) |
||
Line 24: | Line 24: | ||
highlightFillColor:'#0077cc', style:6, name:'', fixed:true} | highlightFillColor:'#0077cc', style:6, name:'', fixed:true} | ||
); | ); | ||
− | p.num = i; | + | |
− | p.rendNode.onclick = function() { | + | p.num = i; // memorize the number of this point in the array |
+ | p.rendNode.onclick = (function() { | ||
var v = prompt("New value:",this.Y())*1.0; | var v = prompt("New value:",this.Y())*1.0; | ||
this.setPosition(JXG.COORDS_BY_USER,this.X(),v); | this.setPosition(JXG.COORDS_BY_USER,this.X(),v); | ||
y[this.num] = v; | y[this.num] = v; | ||
brd.update(); | brd.update(); | ||
− | } | + | }).apply(p); |
points.push(p); | points.push(p); |