javascript - Highcharts: Cannot get example to display chart -


i cannot following chart display. following jquery. i've tried other examples replacing jquery , works. have files in same folder, including data.csv.

$(document).ready(function () {     var options = {         chart: {             renderto: 'container',             defaultseriestype: 'column'         },         < ...more options here... >     };       $.get('./data.csv', function (data) {         // split lines         var lines = data.split('\n');         $.each(lines, function (lineno, line) {             var items = line.split(',');              // header line containes categories             if (lineno == 0) {                 $.each(items, function (itemno, item) {                     if (itemno > 0) options.xaxis.categories.push(item);                 });             }              // rest of lines contain data name in first position             else {                 var series = {                     data: []                 };                 $.each(items, function (itemno, item) {                     if (itemno == 0) {                         series.name = item;                     } else {                         series.data.push(parsefloat(item));                     }                 });                  options.series.push(series);              }          });          var chart = new highcharts.chart(options);     }); }); 

the csv file looks like:

categories,apples,pears,oranges,bananas john,8,4,6,5 jane,3,4,2,3 joe,86,76,79,77 janet,3,16,13,15 

here example trying working:

http://www.highcharts.com/studies/data-from-csv.htm

edit: realized chart displays on firefox. have been using chrome. weird. however, example link above works on both.

in chrome not allowed use ajax local files. if want such thing use xampp or wamp create local server. firefox doens't have such limits.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -