Data plot: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 4: | Line 4: | ||
var maxX = 0.0; | var maxX = 0.0; | ||
var maxY = 0.0; | var maxY = 0.0; | ||
var minY = 100000.0; | |||
var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-100,5000,25000,-400],axis:true}); | var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-100,5000,25000,-400],axis:true}); | ||
Line 17: | Line 18: | ||
if (x[i]>maxX) maxX = x[i]; | if (x[i]>maxX) maxX = x[i]; | ||
if (y[i]>maxY) maxY = y[i]; | if (y[i]>maxY) maxY = y[i]; | ||
if (y[i]<minY) minY = y[i]; | |||
} | } | ||
brd.setBoundingBox([-100,maxY*1.01,maxX*1.01, | brd.setBoundingBox([-100,maxY*1.01,maxX*1.01,minY*0.99]); | ||
var c = brd.create('curve',[x,y],{strokeColor:color[nr%color.length]}); | var c = brd.create('curve',[x,y],{strokeColor:color[nr%color.length]}); | ||
nr++; | nr++; |