DanielCW
DanielCW

Reputation: 149

Highcharts - Adding tooltip to ONLY certain dynamically added series

Using highcharts, I am adding multiple series to an exist chart. When adding the series I need to be able to set tooltip on or off depending on the series added.

Here is where I am at:


widget.chart.addSeries({
      data: newSeries, 
      color: color, 
      tooltip: { 
        enabled: true, 
        formatter: function() { 
          return 'test';
        }  
      }
    });

Upvotes: 1

Views: 2046

Answers (1)

Ricardo Lohmann
Ricardo Lohmann

Reputation: 26320

Try this.

Inside chart options.

tooltip: {
    formatter: function() {
        var text = false;
        if(this.series.name == "GOOG") {
        // just an example of serie name
        // you can use index or other data too
            text = 'test';
        }

        return text;
    }
}

demo

Upvotes: 3

Related Questions