Highcharts:组合双轴中的动态向下钻取(堆叠图表)

时间:2013-04-15 22:34:42

标签: javascript charts highcharts

我有这个问题,这是我的jsfiddle:http://jsfiddle.net/pLDeq/1/

你可以看到,当我点击一列时我改为堆积图表,但有时我会有3列,5等,我的问题是,是否存在检测这种情况的方法?

if (drilldown) { 
     setChart([drilldown.name, drilldown.name1, drilldown.name2, drilldown.name3, drilldown.name4, drilldown.name5],  drilldown.categories,  [drilldown.data, drilldown.data1, drilldown.data2, drilldown.data3, drilldown.data4, drilldown.data5], drilldown.color, [drilldown.type]); 
}

我无法解决的另一件事是,为什么我不能在传说和工具提示的钻取中获得名称?我可以格式化下钻的工具提示吗?'

1 个答案:

答案 0 :(得分:1)

1)从data1,data2,data3等更改为:

                data:[[
                    {name:'Recomendación',y:17},
                    {name:'Recomendación',y:20},
                    {name:'Recomendación',y:50}
                ],[
                    {name:'Area de Oportunidad',y:3},
                    {name:'Area de Oportunidad',y:0},
                    {name:'Area de Oportunidad',y:3}
                ],[
                    {name:'Observación',y:1},
                    {name:'Observación',y:1},
                    {name:'Observación',y:2}
                ]],

然后在setChart中使用:

setChart([drilldown.name, drilldown.name1, drilldown.name2, drilldown.name3, drilldown.name4, drilldown.name5],  drilldown.categories,  drilldown.data, drilldown.color, [drilldown.type]); 

2)为名字做同样的事。