Home Forums Chart Support Controls the number of tooltips according to the number of availble – legends Reply To: Controls the number of tooltips according to the number of availble – legends

#34014

@nguyentanson1996gmail-com,

You can hide the information related to hidden dataseries by setting toolTipContent of that particular dataseries to null. Please find the code-snippet below.

itemclick : function(e) {
  var content;
  if (typeof(e.dataSeries.visible) === "undefined" || e.dataSeries.visible) {
    e.dataSeries.visible = false;
    content = e.chart.data[e.dataSeriesIndex].toolTipContent;
    e.dataSeries.toolTipContent = null;
  }
  else {
    e.dataSeries.visible = true;
    e.dataSeries.toolTipContent = content;
  }
  chart.render();
}

Please take a look at this JSFiddle for complete code.
Remove Hidden Series from Tooltip


Vishwas R
Team CanvasJS