Jquery – required help in array function

I have an array like this.


I’m creating a line chart using highcharts

Data excepted format for line chart is


I got no idea on how to do it.

Actually the result is from a ajax result.

I get the result in Object Object
and I converted it using JSON.stringify
. But after converting I get both label and value.

Someone help me out to get the data in the chart expected format.

Thanks in advance.

You can map the current array and return each label inside it into a new array etc

var new_arr = $.map(arr, function(itm) { return [itm.label, itm.value]; });
Hello, buddy!责编内容来自:Hello, buddy! (源链) | 更多关于

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 前端开发 » Jquery – required help in array function

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录