javascript - highcharts add series from array -
i trying add series javascript array, not work. code shows:
var values=[]; (var i=0;i<string.data.length;i++) values[i]=string.data[i].value;
that sets values [11,9,9,8,7,7,5,4,4,2]. highcharts
$(function () { $('#uniquescancount').highcharts({ ... series: [{ name: 'unique scans: ', data: values, }] }); });
the series not show data. can me out? thanks!
there must wrong values
array, caused loop or string.data
, here working example using var series.data
, values arrary:
var values= [11,9,9,8,7,7,5,4,4,2]; $('#container').highcharts({ series: [{ data: values }] });
Comments
Post a Comment