How to hide highChart plotLine label until mouseover?

后端 未结 1 1961
暖寄归人
暖寄归人 2021-01-20 02:33

http://jsfiddle.net/leongaban/n36y336z/

I have a plotline series on my highChart which has a label. What I\'m trying to do is hide the label until mouseover

1条回答
  •  醉话见心
    2021-01-20 02:46

    Use display instead of visible

    plotLines: [{ // mark the weekend
      label: {
        text: 'label',
        style: {
          display: 'none'
        }
      },
      events: {
        mouseover: function (e) {
          this.label.element.style.display='block';
        },
        mouseout: function (e) {
          this.label.element.style.display='none';
        }
      }
    }], 
    

    JSFiddle demo

    0 讨论(0)
提交回复
热议问题