grid aggregates

by whoamiwho

HTML

<script src="http://cdn.kendostatic.com/2012.1.322/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.1.322/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.1.322/styles/kendo.metro.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.1.322/styles/kendo.dataviz.min.css">
                <div id="chart"></div>

JavaScript

datasource = new kendo.data.DataSource({
    transport: {
        read: {
            //using jsfiddle echo service to simulate JSON endpoint
            url: "/echo/json/",
            dataType: "json",
            type: "POST",
            data: {
                // /echo/json/ echoes the JSON which you pass as an argument
                json: JSON.stringify([
                    {
                    "country": "Spain",
                    "year": "2008",
                    "unit": "GWh",
                    "solar": 2578,
                    "hydro": 26112,
                    "wind": 32203,
                    "nuclear": 58973},
                {
                    "country": "Spain",
                    "year": "2007",
                    "unit": "GWh",
                    "solar": 508,
                    "hydro": 30522,
                    "wind": 27568,
                    "nuclear": 55103},
                {
                    "country": "Spain",
                    "year": "2006",
                    "unit": "GWh",
                    "solar": 119,
                    "hydro": 29831,
                    "wind": 23297,
                    "nuclear": 60126},
                {
                    "country": "Spain",
                    "year": "2005",
                    "unit": "GWh",
                    "solar": 41,
                    "hydro": 23025,
                    "wind": 21176,
                    "nuclear": 57539},
                {
                    "country": "Spain",
                    "year": "2004",
                    "unit": "GWh",
                    "solar": 56,
                    "hydro": 34439,
                    "wind": 15700,
                    "nuclear": 63606},
                {
                    "country": "Spain",
                    "year": "2003",
                    "unit": "GWh",
                    "solar": 41,
                    "hydro": 43897,
                    "wind": 12075,
                    "nuclear":...