user8977154
user8977154

Reputation: 403

Hide data series from tooltip

How can I exclude a specific data series from showing in the tooltip with tooltip.trigger = axis?

I'm asking because I have a very complex graph with one line chart, two bar charts and one heatmap. And the heatmap has so many data that the tooltip ends up with too many lines. The heatmap values are not very important, so I would like to remove them from showing in the tooltip.

Right now I'm using formatter to exclude them, but is there any other way?

Upvotes: 6

Views: 7104

Answers (1)

Sergey Fedorov
Sergey Fedorov

Reputation: 4420

I do exactly the same: adding a new attribute to the series and checking it from formatter.

Something like this:

series: [{
// ...
  showInTooltip: true
// ...
}]

// ----

formatter: series => {
  var displayed = series.filter(item => item.showInTooltip);
  // work with displayed where showInTooltip === true
}

Also you can store callback instead attribute and it will work.

Updated: Suddenly I found undocumented feature and it will solved you trouble by the right way, apparently.

series: [{
// ...
  tooltip: {
     show: false
  }
// ...
}]

Upvotes: 20

Related Questions