How to hide highChart plotLine label until mouseover?

后端 未结 1 1960
暖寄归人
暖寄归人 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)
提交回复
热议问题