Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Print Array in HighChart

I am facing a problem printing an array into HighCharts.

var FirstTurnOver =new Array();

This array Contains 100,345,212,444,121,111,65 all values are dynamically fetching from the server. Now I have to show them in series.

series: [{
    data: FirstTurnOver  
}]

This doesn't print anything on my Y axis.

like image 620
Vishvendu Palawat Avatar asked Aug 24 '26 12:08

Vishvendu Palawat


1 Answers

Your array contains numbers of strings, you just need to convert strings to numbers

FirstTurnOver.map(function (el) { return +el  })
// The same but a little shorter
// FirstTurnOver.map(Number) 
// or before push 
// FirstTurnOver.push(+billerdetails1);

Example

like image 119
Oleksandr T. Avatar answered Aug 27 '26 01:08

Oleksandr T.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!