深入多层次的Highchart [英] Drilldown multiple levels Highchart

查看:86
本文介绍了深入多层次的Highchart的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们喜欢在Highchart的多个层面上进行深入研究。在Highchart中是否已有示例?



当前使用的代码

<$ p $ $ {
图表:{type:'column'},
credits:{enabled:false},
title:{text :title},
xAxis:{
类别:[
'Instroom',
'Rijdend',
'Úitstroom'
]
},
yAxis:{title:{text:ytitle}},
legend:{enabled:true},
plotOptions:{series:{borderWidth:1,dataLabels:{enabled:true ,}}},
series:first,
drilldown:{
series:drillDownObject(second)
}
});


解决方案

这是可能的,只需添加所有向下钻取系列,点与向下钻取之间的连接。请参阅: http://jsfiddle.net/6LXVQ/2/

 系列:[{
name:'Things',
colorByPoint:true,
data:[{
名称:'动物',
y:5,
钻取:'动物'
}]
}],
钻取:{
series:[{
id:'animals',
name:'Animals',
data:[{
name:'Cats',
y:4,
drilldown :'猫'
},['狗',2],
['Cows',1],
['Sheep',2],
['Pigs' ,1]
]
},{

id:'cats',
data:[1,2,3]
}]
}


We like to Drilldown on multiple levels in Highchart. Is there already an example in Highchart?

Currently used code:

$(div).highcharts({
    chart: {type: 'column'},
    credits: {enabled: false},          
    title: {text: title},
    xAxis: {
        categories: [
            'Instroom',
            'Rijdend',
            'Úitstroom'
        ]
    },
    yAxis: {title: {text: ytitle}},
    legend: {enabled: true},
    plotOptions: {series: { borderWidth: 1, dataLabels: {enabled: true,}}},
    series: first,
    drilldown: {
        series: drillDownObject(second)
    }
});

解决方案

It's possible, just add all drilldown series, then create connection between point and drilldown. See: http://jsfiddle.net/6LXVQ/2/

    series: [{
        name: 'Things',
        colorByPoint: true,
        data: [{
            name: 'Animals',
            y: 5,
            drilldown: 'animals'
        }]
    }],
    drilldown: {
        series: [{
            id: 'animals',
            name: 'Animals',
            data: [{
                name: 'Cats',
                y: 4,
                drilldown: 'cats'
            }, ['Dogs', 2],
                ['Cows', 1],
                ['Sheep', 2],
                ['Pigs', 1]
            ]
        }, {

            id: 'cats',
            data: [1, 2, 3]
        }]
    }

这篇关于深入多层次的Highchart的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆