简体   繁体   中英

How do I toggle off some specified series by default in HighChart?

在此处输入图片说明

As the arrows say in the picture, I want to hide the two series at first. But the user can toggle it on by clicking it.

What should I do?

I made a guess and tried this (to add disabled:true to the settings) but not working:

series: [{
        name: 'PV',
        data: pv_arr,yAxis:0,disabled:true
    },
    {
      name:'UPV',
      data:upv_arr,yAxis:0
    },
    {
      name:'PPV',
      data:ppv_arr,yAxis:1,disabled:true
    }
    ]

Use the visible option :

{
    name: 'PV',
    data: pv_arr,
    yAxis: 0,
    visible: false
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM