Wijmo 5 - FlexGrid and FlexChart

HTML

<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="http://cdn.wijmo.com/5.latest/styles/wijmo.min.css">
<script src="http://cdn.wijmo.com/5.latest/controls/wijmo.min.js"></script>
<script src="http://cdn.wijmo.com/5.latest/controls/wijmo.grid.min.js"></script>
<script src="http://cdn.wijmo.com/5.latest/controls/wijmo.chart.min.js"></script>
<h1>Hello Wijmo 5!</h1>

<p>This is a <b>FlexGrid</b> control:</p>
<div id="theGrid"></div>

CSS

.wj-flexgrid {
  margin: 12px;
  height:200px;
}
.wj-flexchart {
  height: 300px;
  margin: 12px;
}
body {
  margin-bottom: 24pt;
}

JavaScript

onload = function() {
	//create random data
		var data=[];
    for(var i=0;i<30;i++){
      data.push({
        name:"name"+i,
        hindi:Math.floor(Math.random()*100),
        english:Math.floor(Math.random()*100),
        maths:Math.floor(Math.random()*100),
      });
    }
    // create CollectionView on the data (so grid and chart stay in sync)
    var view = new wijmo.collections.CollectionView(data);

    // initialize the grid
    var grid = new wijmo.grid.FlexGrid('#theGrid', {
        columns: [
        	{ binding: 'name', header: 'Name' },
          { binding: 'hindi', header: 'Hindi' },
          { binding: 'english', header: 'English' },
          { binding: 'maths', header: 'Maths' }
				],
        autoGenerateColumns: false,
        itemsSource: view,
    });

    grid.columns.push(new wijmo.grid.Column({
    	isReadOnly:true
    }));
    
    grid.itemFormatter=(panel,r,c,cell)=>{
    	if(panel.cellType==wijmo.grid.CellType.ColumnHeader&&c==4){
      	cell.innerHTML="Total";
      }
      if(panel.cellType==wijmo.grid.CellType.Cell&&c==4){
      	var curStudentData=panel.rows[r].dataItem;
        var total=curStudentData['maths']+curStudentData['english']+curStudentData['hindi'];
        cell.innerHTML=total;
        
      }
    }
}