Difference between revisions of "Data plot"

From JSXGraph Wiki
Jump to navigationJump to search
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,-400]);
+
     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++;

Revision as of 14:37, 13 February 2010


Spalte 1: y-Koordinate, Spalte 2: x-Koordinate