Difference between revisions of "Google style chart"
From JSXGraph Wiki
Jump to navigationJump to searchA WASSERMANN (talk | contribs) |
A WASSERMANN (talk | contribs) |
||
Line 19: | Line 19: | ||
function doIt() { | function doIt() { | ||
+ | var i; | ||
var s = $('eingabe').value.strip(); | var s = $('eingabe').value.strip(); | ||
var a = s.split('\n'); | var a = s.split('\n'); | ||
− | var x = []; | + | var x = [0]; |
− | var y = []; | + | var y = [0]; |
for (var i=0;i<a.length;i++) { | for (var i=0;i<a.length;i++) { | ||
var b = a[i].split(/\s+/); | var b = a[i].split(/\s+/); | ||
Line 32: | Line 33: | ||
} | } | ||
} | } | ||
+ | x[i] = x[i-1]; | ||
+ | y[i] = 0; | ||
brd.createElement('curve', [x,y], {strokeWidth:3, strockeColor:'#0077cc', highlightStrokeColor:'#0077cc',fillColor:'#e6f2fa'}); | brd.createElement('curve', [x,y], {strokeWidth:3, strockeColor:'#0077cc', highlightStrokeColor:'#0077cc',fillColor:'#e6f2fa'}); | ||
} | } |
Revision as of 12:25, 9 May 2009