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 4 posts - 1 through 4 (of 4 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

    #39259

    @nguyentanson1996gmail-com,

    We have just released CanvasJS Charts v3.7 with a few bug fixes related to tooltip & it’s content. Please refer to the release blog for more information. Do download the latest version from our download page and let us know your feedback.


    Vishwas R
    Team CanvaJS

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

You must be logged in to reply to this topic.