Data plot: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 7: | Line 7: | ||
var t = document.getElementById('in_data').value; | var t = document.getElementById('in_data').value; | ||
var data = t.split('\n'); | var data = t.split('\n'); | ||
var maX = 0.0; | |||
var maY = 0.0; | |||
for (i=0;i<data.length;i++) { | for (i=0;i<data.length;i++) { | ||
d = data[i].split(';'); | d = data[i].split(';'); | ||
x[i] = d[1]*1.0; | x[i] = d[1]*1.0; | ||
y[i] = d[0]*1.0; | y[i] = d[0]*1.0; | ||
if (x[i]>maxX) maxX = x[i]; | |||
if (y[i]>maxY) maxY = y[i]; | |||
} | } | ||
brd.setBoundingBox([-100,maxX,maxY,-400]); | brd.setBoundingBox([-100,maxX,maxY,-400]); | ||
c.dataX = x; | c.dataX = x; |