Difference between revisions of "Data plot"

From JSXGraph Wiki
Jump to navigationJump to search
 
(10 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
var minY = 100000.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:[-1,5000,25,-400],axis:true});
  
 
var plotData = function() {
 
var plotData = function() {
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[0]*1.0;
         y[i] = d[0]*1.0;
+
         y[i] = d[1]*1.0;
 
         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];
 
         if (y[i]<minY) minY = y[i];
 
     }
 
     }
     brd.setBoundingBox([-100,maxY*1.01,maxX*1.01,minY*1]);
+
     brd.setBoundingBox([-1,maxY*1.01,maxX*1.05,minY*0.95]);
 
     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++;
Line 28: Line 28:
 
var clearBoard = function() {
 
var clearBoard = function() {
 
     JXG.JSXGraph.freeBoard(brd);  
 
     JXG.JSXGraph.freeBoard(brd);  
     brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-100,5000,25000,-400],axis:true});
+
     brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-100,5000,25,-400],axis:true});
 
     maxX = 0.0;
 
     maxX = 0.0;
 
     maxY = 0.0;
 
     maxY = 0.0;
Line 45: Line 45:
 
Spalte 1: y-Koordinate, Spalte 2: x-Koordinate
 
Spalte 1: y-Koordinate, Spalte 2: x-Koordinate
 
<textarea id="in_data" cols=20 rows=15>
 
<textarea id="in_data" cols=20 rows=15>
  3591 ; 7612  
+
  1 ; 7612  
  3587 ; 7632  
+
  2 ; 7632  
  3594 ; 7640  
+
  3 ; 7640  
  3593 ; 7634  
+
  4 ; 7634  
  3595 ; 7616  
+
  5 ; 7616  
  3596 ; 7607  
+
  6 ; 7607  
  3590 ; 7623  
+
  7 ; 7623  
  3587 ; 7639  
+
  8 ; 7639  
  3596 ; 7635  
+
  9 ; 7635  
  3594 ; 7619  
+
  10 ; 7619  
  3596 ; 7606  
+
  11 ; 7606  
  3596 ; 7612  
+
  12 ; 7612  
  3592 ; 7633  
+
  13 ; 7633  
  3597 ; 7641  
+
  14 ; 7641  
  3594 ; 7637  
+
  15 ; 7637  
  3593 ; 7619  
+
  16 ; 7619  
  3595 ; 7617  
+
  17 ; 7617  
  5059 ; 6673  
+
  18 ; 6673  
  3599 ; 7642  
+
  19 ; 7642  
  3596 ; 7653  
+
  20 ; 7653  
3594 ; 7645
 
3596 ; 7630
 
3595 ; 7634
 
3592 ; 7651
 
3596 ; 7656
 
3593 ; 7653
 
3596 ; 7638
 
3595 ; 7635
 
3596 ; 7640
 
3595 ; 7649
 
3596 ; 7652
 
3595 ; 7646
 
3595 ; 7638
 
3597 ; 7639
 
3594 ; 7649
 
3596 ; 7650
 
3593 ; 7646
 
3596 ; 7639
 
3595 ; 7641
 
3587 ; 7651
 
3595 ; 7650
 
3596 ; 7647
 
3594 ; 7641
 
3596 ; 7637
 
3595 ; 7643
 
3601 ; 7646
 
3602 ; 7645
 
3596 ; 7645
 
3600 ; 7642
 
3594 ; 7649
 
3593 ; 7654
 
3594 ; 7650
 
3598 ; 7641
 
3594 ; 7643
 
3595 ; 7649
 
3594 ; 7660
 
3594 ; 10144
 
3596 ; 15634
 
3599 ; 15633
 
3600 ; 15632
 
3600 ; 15630
 
3600 ; 15631
 
3600 ; 15631
 
3597 ; 15633
 
3596 ; 15634
 
3601 ; 15630
 
3597 ; 15633
 
3597 ; 15632
 
3594 ; 15636
 
3598 ; 15631
 
3598 ; 15631
 
3598 ; 15632
 
3597 ; 15630
 
3595 ; 15632
 
3598 ; 15631
 
3590 ; 15637
 
3597 ; 15630
 
3596 ; 15631
 
3600 ; 15628
 
3598 ; 15630
 
3593 ; 15634
 
3598 ; 15633
 
3592 ; 15635
 
3598 ; 15630
 
3599 ; 15630
 
3598 ; 15631
 
3594 ; 15633
 
3599 ; 15632
 
3591 ; 15636
 
3598 ; 15632
 
3596 ; 15631
 
3600 ; 15629
 
3597 ; 15631
 
3595 ; 15632
 
3600 ; 15631
 
3598 ; 15635
 
3599 ; 15631
 
3604 ; 15631
 
3609 ; 15630
 
3612 ; 15631
 
3614 ; 15631
 
3618 ; 15633
 
3623 ; 15631
 
3627 ; 15631
 
3633 ; 15630
 
3636 ; 15632
 
3641 ; 15631
 
3648 ; 15631
 
3647 ; 15635
 
3658 ; 15630
 
3664 ; 15629
 
3668 ; 15630
 
3672 ; 15631
 
3673 ; 15633
 
3684 ; 15631
 
3688 ; 15631
 
3694 ; 15631
 
3699 ; 15631
 
3704 ; 15631
 
3709 ; 15631
 
3712 ; 15633
 
3721 ; 15634
 
3728 ; 15631
 
3737 ; 15630
 
3745 ; 15631
 
3753 ; 15633
 
3766 ; 15630
 
3772 ; 15632
 
3781 ; 15631
 
3725 ; 6203
 
3674 ; 569
 
3664 ; 587
 
3653 ; 606
 
3654 ; 614
 
 
  </textarea>
 
  </textarea>
 
</form>
 
</form>
 
</html>
 
</html>
 +
 +
[[Category:Examples]]
 +
[[Category:Charts]]

Latest revision as of 09:41, 6 July 2011


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