在我从backing bean创建的字符串下面,然后我创建了用于向下钻取图表的JavaScript文件,并将值字符串传递给用于向下钻取图表的创建方法。我的问题是,如果我将下面的数据硬编码成系列:[...等]它的工作正常,但我需要使用来自支持bean的字符串
{
name: ' Chart ',
colorByPoint: true,
data: [{name: ' Indeals ', y: 1150,drilldown: ' Indeals ' },
{name: ' NR ' ,y: 1050,drilldown: ' NR ' },
{name: ' Die ' ,y: 950,drilldown: ' Die ' },
{name: ' CL ' ,y: 900,drilldown: ' CL ' },
{name: ' Win ' ,y: 1100,drilldown: ' Win ' }]
},
drilldown .. ....
我在此附加了示例代码:http://jsfiddle.net/7jevddL4/71/
的javascript
$(function () {
var brandsData = [],
drilldownSeries = [];
brandsData = [{
name: "Drive",
y: 1,
drilldown: "drive"
},];
drilldownSeries = [ {
"data": [
["Tiger Team", 10]
],
id: "drive"
},];
// Create the chart
$('#container').highcharts({
chart: {
type: 'column'
},
series: [{
name: "Team",
colorByPoint: true,
data: brandsData
}],
drilldown: {
series: drilldownSeries
}
});
});