Google style chart: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 6: | Line 6: | ||
var i; | var i; | ||
var t = ''; | var t = ''; | ||
for ( | for (i=0;i<=20;i++) { | ||
t += i+' '+brd.round(((Math.random()*4-2)+3),2)+'\n'; | t += i+' '+brd.round(((Math.random()*4-2)+3),2)+'\n'; | ||
} | } | ||
Line 12: | Line 12: | ||
var x = [0]; | var x = [0]; | ||
var y = [0]; | var y = [0]; | ||
for ( | for (i=0;i<a.length;i++) { | ||
var b = a[i].split(/\s+/); | var b = a[i].split(/\s+/); | ||
b[0]=b[0]*1.0; | b[0]=b[0]*1.0; | ||
Line 21: | Line 21: | ||
} | } | ||
brd.createElement('point', [b[0],b[1]], {strokeWidth:2, strokeColor:'#ffffff', | brd.createElement('point', [b[0],b[1]], {strokeWidth:2, strokeColor:'#ffffff', | ||
highlightStrokeColor:'#ffffff', fillColor:' | highlightStrokeColor:'#ffffff', fillColor:'#0077cc', | ||
highlightFillColor:'# | highlightFillColor:'#e6f2fa', style:6, name:''}); | ||
} | } | ||
x.push(x[ | x.push(x[x.length-1]); | ||
y.push(0); | y.push(0); | ||
brd.createElement('curve', [x,y], {strokeWidth:3, strokeColor:'#0077cc', highlightStrokeColor:'#0077cc',fillColor:'#e6f2fa'}); | brd.createElement('curve', [x,y], {strokeWidth:3, strokeColor:'#0077cc', highlightStrokeColor:'#0077cc',fillColor:'#e6f2fa'}); |