How to add click event handler on an edge node of partition chart in amCharts V5

Discussão em 'Angular' iniciado por arminrock, Outubro 29, 2024.

  1. arminrock

    arminrock Guest

    I'm using amCharts V5 in my angular project.
    I use partition chart as a kind of a filter. So that when one clicks on edge node (the last node that does not have any children) I will draw another chart underneath.
    My problem at this moment is to make click working. There is no explicit example in docs but I assumed that this should work

    series.nodes.template.events.on("click", function (event) {
    console.log("Clicked on node:", event);
    });


    and here's how I create my series

    let series = container.children.push(
    am5hierarchy.Partition.new(root, {
    singleBranchOnly: false,
    orientation: this.chartData.orientation,
    downDepth: 1,
    initialDepth: 2,
    valueField: 'value',
    categoryField: 'name',
    childDataField: 'children',
    interactive: true,
    cursorOverStyle: "pointer",
    exportable: true,
    interactiveChildren: true
    })
    );


    I don't even find anything in docs saying that it's not possible. Please someone help me solve this issue.

    Continue reading...

Compartilhe esta Página