Home forums Feature Requests & Feedback Event handling on Chart

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Sunil Urs 3 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4607

    timverbruggen
    Participant

    Hi there,

    I’d like to have 16 or more charts on a page. The chart should contain real data.
    By clicking one of the charts id like to open a page with only that Chart

    Is this a possibility?

    Tim

    #4609

    Sunil Urs
    Keymaster

    Yes, you can do so. Because you don’t need event handler on any particular dataPoint/dataSeries but the entire Chart, you can directly use Chart’s Container element. Below is how

     

    <div id=”chartContainer” data-url=”http://canvasjs.com” style=”width: 600px; height: 300px;”></div>

     

    //Am using  jQuery here. You can do so even with plain javascript

    $(“#chartContainer”).click(function () {

    window.location.href = $(this).data(“url”);

    });

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

You must be logged in to reply to this topic.