Highcharts多级别类别

Jus*_*nas 0 split categories highcharts

我正在使用highcharts,需要列出列出的类别和子类别.

例如:

我有一些运动员,我希望按地点和性别列出奖牌.

因此必须列出所有奖牌类型,并将这些类别分为男性和女性

    |    GOLD    |   SILVER   |   BRONZE  |
    |male|female||male|female||male|female|
    ---------------------------------------
    | cl | cl    | cl |  cl   | cl |  cl  |
Run Code Online (Sandbox Code Playgroud)

*cl =某些列,每个性别都有该类型奖牌的数据

在高等领域是可能的,如果是的话,怎么样?

小智 8

这是一个旧请求,但由于我不得不做类似的事情,我会分享解决方案 - 基于HighCharts的多个类别插件 - 这里是来自jsfiddle的代码 - http://jsfiddle.net/fieldsure/Lr5sjh5x/2 /

$(function () {
    var chart = new Highcharts.Chart({
        chart: {
            renderTo: "container",
            type: "column",
            borderWidth: 5,
            borderColor: '#e8eaeb',
            borderRadius: 0,
            backgroundColor: '#f7f7f7'
        },
        title: {
            style: {
                'fontSize': '1em'
            },
            useHTML: true,
            x: -27,
            y: 8,
            text: '<span class="chart-title"> Grouped Categories with 2 Series<span class="chart-href"> <a href="http://www.blacklabel.pl/highcharts" target="_blank"> Black Label </a> </span> <span class="chart-subtitle">plugin by </span></span>'
        },
        yAxis: [{ // Primary yAxis
            labels: {
                format: '${value}',
                style: {
                    color: Highcharts.getOptions().colors[0]
                }
            },
            title: {
                text: 'Daily Tickets',
                style: {
                    color: Highcharts.getOptions().colors[0]
                }
            }
        }, { // Secondary yAxis
            title: {
                text: 'Invoices',
                style: {
                    color: Highcharts.getOptions().colors[0]
                }
            },
            labels: {
                format: '${value}',
                style: {
                    color: Highcharts.getOptions().colors[0]
                }
            },
            opposite: true
        }]
        ,
        series: [{
            name: 'Daily',
            type: 'column',
            yAxis: 1,
            data: [4, 14, 18, 5, 6, 5, 14, 15, 18],
            tooltip: {
                valueSuffix: ' mm'
            }

        }, {
            name: 'Invoices',
            type: 'column',
            data: [4, 17, 18, 8, 9, 5, 13, 15, 18],
            tooltip: {
                valueSuffix: ' °C'
            }
        }],
        xAxis: {
            categories: [{
                name: "1/1/2014",
                categories: ["Vendor 1", "Vendor 2", "Vendor 3"]
            }, {
                name: "1/2/2014",
                categories: ["Vendor 1", "Vendor 2", "Vendor 3"]
            }, {
                name: "1/3/2014",
                categories: ["Vendor 1", "Vendor 2", "Vendor 3"]
            }]
        }
    });
});
Run Code Online (Sandbox Code Playgroud)