Skip to content

Highcharts.js

Andrey Gershun edited this page May 27, 2015 · 3 revisions

Highcharts.js with AlaSQL

You can use AlaSQL to load and prepare data for Highcharts.js library.

Source: Stackoverflow.com

Question

How to load CSV file from desktop and use it in Highcharts?

Answer

You can add the following code to your page:

    <script src="http://alasql.org/console/alasql.min.js"></script> 
    <input id="readfile" type="file" onchange="loadFile(event)"/>
    <script>
        function loadFile(event) {
            alasql('SELECT * FROM FILE(?,{headers:true})', [event],function(data){
                 // Process your data
            });
        );
    </script>

See the working example in the code snippet.

Clone this wiki locally