Home Forums Chart Support Can we define a tooltip click event?

Can we define a tooltip click event?

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

    Hi, I am using different properties of tooltip like cornerRadius, animationEnabled, shared, contentFormatter. Is there any property which helps us to define click event on tooltip also?

    #15133

    @shv22,

    You can do so by placing any HTML element (div, button etc.) in the toolTipContent and attaching click event handler to it. Please refer below codesnippet for toolTipContent that can be provided for such scenario.

    toolTipContent: "<div id='toolTipContent' onclick='clickHandler()'>{label}: {y}</div>",

    Also, have a look at this JSFiddle for complete code.

    Attaching Click Event to toolTipContent

    ___
    Suyash Singh
    Team CanvasJS

    #15136

    Thanks for the fiddle. This helps me a lot.

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

You must be logged in to reply to this topic.