Highcharts test tool

by Mayank

HTML

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://highcharts.github.io/export-csv/export-csv.js"></script>

<div id="container"></div>


<h3>Exported CSV:</h3>
<pre id="preview"></pre>

CSS

#container {
    height: 300px;
    margin-top: 2em;
}
pre {
    border: 1px solid silver;
    border-radius: 0.5em;
    padding: 1em;
    color: green;
}

JavaScript

var chart = new Highcharts.Chart({

    chart: {
        renderTo: 'container'
    },

    title: {
        text: 'Categorized chart'
    },
    
    xAxis: {
        categories: [1496275200000,1498867200000,1501545600000,1504224000000],
        type : 'datetime'
    },

    series: [{
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
    }]

});

$('#preview').html(chart.getCSV());