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

Controls the number of tooltips according to the number of availble – legends

Viewing 3 posts - 1 through 3 (of 3 total)
  • #34001

    I have a problem with my Tooltip
    Example: I have 3 visible series and 1 invisible.
    Can I only show 3 tooltip for 3 visible series?
    I don’t want to show all 4 series in this case?

    #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

    #34024

    Thank you @Vishwas R so much. That’s exactly what I need in this case

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.