HighChart可以在一次向下钻取中支持多种图表类型吗?

时间:2016-05-09 14:16:30

标签: javascript jquery graph highcharts

从以下小提琴中我们可以在highCharts中实现向下钻取:http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/drilldown/basic/

代码:

$(function () {

// Create the chart
$('#container').highcharts({
    chart: {
        type: 'column'
    },
    title: {
        text: 'Basic drilldown'
    },
    xAxis: {
        type: 'category'
    },

    legend: {
        enabled: false
    },

    plotOptions: {
        series: {
            borderWidth: 0,
            dataLabels: {
                enabled: true
            }
        }
    },

    series: [{
        name: 'Things',
        colorByPoint: true,
        data: [{
            name: 'Animals',
            y: 5,
            drilldown: 'animals'
        }, {
            name: 'Fruits',
            y: 2,
            drilldown: 'fruits'
        }, {
            name: 'Cars',
            y: 4,
            drilldown: 'cars'
        }]
    }],
    drilldown: {
        series: [{
            id: 'animals',
            data: [
                ['Cats', 4],
                ['Dogs', 2],
                ['Cows', 1],
                ['Sheep', 2],
                ['Pigs', 1]
            ]
        }, {
            id: 'fruits',
            data: [
                ['Apples', 4],
                ['Oranges', 2]
            ]
        }, {
            id: 'cars',
            data: [
                ['Toyota', 4],
                ['Opel', 2],
                ['Volkswagen', 2]
            ]
        }]
    }
});
});

但我的要求是当您执行向下钻取时,我需要显示多个显示相同数据的图表,例如样条曲线和条形图。我尝试了很多试验和错误,但没有运气。是否可以使用HighCharts或任何其他jQuery插件实现此类功能?请分享您的想法。

我现有的HighCharts图表:

enter image description here

它是条形和样条曲线的组合。

当我点击一个条形图时,这应该会产生以下向下钻取视图:

enter image description here

请帮助实现这一目标。

0 个答案:

没有答案