Home forums Using CanvasJS Stacked area click

This topic contains 5 replies, has 2 voices, and was last updated by  Suyash Singh 4 months ago.

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

    ToasterSch
    Member

    Hi there,

    is there an opinion to get the click Event in the stached area?

    BR
    ToasterSch

    #14907

    Suyash Singh
    Moderator

    @toastersch,

    Are you looking for this.

    ___
    Suyash Singh
    Team CanvasJS

    #14908

    ToasterSch
    Member

    yeah this is the correct function, but it is only responding to the datapoint marker not for the coloured area of an stacked area chart

    #14910

    Suyash Singh
    Moderator

    @toastersch,

    Sorry this feature is not available as of now.

    ___
    Suyash Singh
    Team CanvasJS

    #14913

    ToasterSch
    Member

    hi,

    @Suyash

    I found a solution in suing the contentformatter:

    toolTip: {contentFormatter: onCanvasClick}

    function onCanvasClick(e) {
    document.getElementById(“eventYValue”).innerHTML = e.entries[0].dataSeries.name;
    };
    so i get the dataseries Name and can make my selection for the drilldrown

    chartContainer.addEventListener(‘click’, onDataSeriesClick); // and here im catching the click

    BR
    ToasterSch

    #14916

    Suyash Singh
    Moderator

    @toastersch,

    Thank you for letting us know about the workaround.

    As far as the drill down is considered, the approach might work fine. However, you need to take into account the fact that toolTip might pop up and fire event even when the mouse moves out of the filled area of the stackedArea chart.

    ___
    Suyash Singh
    Team CanvasJS

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

You must be logged in to reply to this topic.