【发布时间】:2012-05-01 21:00:00
【问题描述】:
如果我们有这样的代码
yAxis : {
title : {
text : 'Exchange rate'
},
plotLines : [{
value : 0.6738,
color : 'green',
dashStyle : 'shortdash',
width : 2,
label : {
text : 'Last quarter minimum'
}
}, {
value : 0.7419,
color : 'red',
dashStyle : 'shortdash',
width : 2,
label : {
text : 'Last quarter maximum'
}
}]
},
如何获取 plotlines json 字符串并将其分配给一个变量并将此变量传递给 plotline 对象? 我试过这样的事情
var jsonObj = [];
jsonObj.push({ "value": 1256211571000, "color": '#D2691E', "width": 1, "label": { "text": 'rinse'} });
var myLines = JSON.stringify(jsonObj);
然后将 mylines 传递给 plotlines 但它并没有真正起作用
【问题讨论】:
-
你想做什么?你为什么使用
JSON.stringify? “将变量传递给 [an] 对象”是什么意思?
标签: javascript jquery json highcharts highstock