Data plot: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 12: | Line 12: | ||
var t = document.getElementById('in_data').value; | var t = document.getElementById('in_data').value; | ||
var data = t.split('\n'); | var data = t.split('\n'); | ||
for (i=0;i<data.length;i++) { | for (i=0;i<data.length-1;i++) { | ||
d = data[i].split(';'); | d = data[i].split(';'); | ||
x[i] = d[1]*1.0; | x[i] = d[1]*1.0; | ||
Line 20: | Line 20: | ||
if (y[i]<minY) minY = y[i]; | if (y[i]<minY) minY = y[i]; | ||
} | } | ||
brd.setBoundingBox([-100,maxY*1.01,maxX*1.01,minY*1]); | brd.setBoundingBox([-100,maxY*1.01,maxX*1.01,minY*1]); | ||
var c = brd.create('curve',[x,y],{strokeColor:color[nr%color.length]}); | var c = brd.create('curve',[x,y],{strokeColor:color[nr%color.length]}); |