highcharts 里面 这段代码: series: [{ name: **, data:** }]怎么把一个动态数组放进data中 50
例子给的静态数组,直接写变量名称不对。。series:[{data:[29.9,71.5,106.4,129.2,144.0,176.0,135.6,148.5,216....
例子给的静态数组,直接写变量名称不对。。
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
例如:
var data = "1,2,3,4,5,6,7,8,9";
var arr = data.split(',');
var arr1 = [1,2,3,4,5,6,7,8,9];
series: [{
data:arr}]这样就不行!
series: [{
data:arr1}]这样就行!
请高手指教啊!!在线等... 展开
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
例如:
var data = "1,2,3,4,5,6,7,8,9";
var arr = data.split(',');
var arr1 = [1,2,3,4,5,6,7,8,9];
series: [{
data:arr}]这样就不行!
series: [{
data:arr1}]这样就行!
请高手指教啊!!在线等... 展开
展开全部
var datetimeCom = '[';
var growth='[';
$.each(rows, function (v1, v2) {
datetimeCom += "\'" + v2.MonitorTime + "\',";
growth += v2.Add + ",";
});
if (datetimeCom != '[') {
datetimeCom = datetimeCom.substr(0, datetimeCom.length - 1)+"]";
growth = growth.substr(0, growth.length - 1)+"]";
}
绑定赋值:(chart为var chart= new Highcharts.Chart......)
chart.xAxis[0].setCategories(eval(datetimeCom));
chart.series[0].setData(eval(growth));
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询