Manipulate csv data

Description

The following code shows how to Manipulate csv data.

Example


<!DOCTYPE html>
<html>
<head>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<script type='text/javascript'>
$(function () {<!--from w w w. ja  va2  s.c  om-->
    $('#container').highcharts({
        data: {
            csv: document.getElementById('csv').innerHTML,
            parsed: function (columns) {
                $.each(columns, function () {
                    this.splice(4, 7);
                });
            }
        },
    });
});
</script>
</head>
<body>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/data.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="height: 400px"></div>
<pre id="csv" style="display:none">Year,Annual mean,5 year mean
2004,2.49,0.56
2005,0.63,1.57
2006,2.56,0.54
2007,0.59,1.56
2008,2.44,0.56
2009,0.57,0.55
2010,2.64,1.54
2011,0.52,
2012,2.52,</pre>

</body>
</html>

Click to view the demo





















Home »
  highcharts »
    Chart Setup »




3D Chart
Chart
Chart Style
Data
Event
Export
Legend
Title
Tooltip
Tooltip Format