Javascript 如何在highchart中隐藏分组类别

Javascript 如何在highchart中隐藏分组类别,javascript,Javascript,大家好,非常感谢你们的支持,我有下面的highchart代码,一切正常,但有2个类别,我只想显示一个,但我想在工具提示中保留它的数据,所以有没有办法隐藏第一个类别,并显示其中一个。我也在代码中注释了我想要的东西。任何帮助都将不胜感激。谢谢 $(function () { var chart = new Highcharts.Chart({ chart: { renderTo: "container", type: "line", borde

大家好,非常感谢你们的支持,我有下面的highchart代码,一切正常,但有2个类别,我只想显示一个,但我想在工具提示中保留它的数据,所以有没有办法隐藏第一个类别,并显示其中一个。我也在代码中注释了我想要的东西。任何帮助都将不胜感激。谢谢

$(function () {
var chart = new Highcharts.Chart({
    chart: {
        renderTo: "container",
        type: "line",
        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 <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>'
    },
    series: [{
            name:"Low",
        data: [4, 14, 18, 5, 6, 5, 14, 15, 18]
    }],
    xAxis: {        
        categories: [{
            name: "20",//should not hide this
            categories: ["21", "22", "23","24"],
            // I want to do hide this categories:["21", "22", "23","24"]
        }, {
            name: "25", //should not hide this
            categories: ["26", "27", "28","29"]
            // I want to do hide this categories:["26", "27", "28","29"]
        }, {
            name: "30",// //should not hide this
            categories: ["31", "32", "33","34"]
            // I want to do hide this categories:["31", "32", "33","34"]
        }]
    }
});
$(函数(){
var图表=新的Highcharts.图表({
图表:{
renderTo:“容器”,
键入:“行”,
边框宽度:5,
边框颜色:“#e8eaeb”,
边界半径:0,
背景颜色:“#F7F7”
},
标题:{
风格:{
“fontSize”:“1em”
},
是的,
x:-27,
y:8,
文本:“分组类别插件依据”
},
系列:[{
名称:“低”,
数据:[4,14,18,5,6,5,14,15,18]
}],
xAxis:{
类别:[{
名称:“20”//不应隐藏此
类别:[“21”、“22”、“23”、“24”],
//我想隐藏这些类别:[“21”、“22”、“23”、“24”]
}, {
名称:“25”,//不应隐藏此
类别:[“26”、“27”、“28”、“29”]
//我想隐藏这些类别:[“26”、“27”、“28”、“29”]
}, {
名称:“30”///不应隐藏此
类别:[“31”、“32”、“33”、“34”]
//我想隐藏这些类别:[“31”、“32”、“33”、“34”]
}]
}
});
}))