Home forums Chart Support Whole canvas as a hyperlink


Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #9479


    How can I make the whole chart canvas to be linked to another page? I tried to add the “a” tag to the chart canvas container, but it allows clicking and transferring to another page only when you click on the tooltip. What I need is to be able to click in any place of the chart and go to a certain page.


    Use onclick to make whole canvas to be linked to another page/ url as shown below,
    <div id="chartContainer" onclick="redirect()"></div>
    then add a function “redirect” to your javascript code, which will contain a link to another page/ url

    function redirect()
        window.location = "https://canvasjs.com/" ;// loads webpage in the current tab
        // window.open = "https://canvasjs.com/" ;// loads webpage in the new tab

    Thank you.


    Hmm, it appeared to be working only on desktop browsers. On mobile devices you have to tap at least 10 times to trigger the ‘onclick’ event. Do you know what the problem is?


    Hi, please help me how to create hyperlink to each sub chart of the canvas??



    You can href the chart-container div. Here is an example.

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

You must be logged in to reply to this topic.