Skip to content

Stacked BarChart: Legend Click Event & Stacked Bar-Item Click Event #4043

@AdnanBoota

Description

@AdnanBoota

Hi Team Plotly,

I want to develop some scenarios using stacked-histogram, but I am unable to achieve expected results. My scenarios are as follows:

  1. legend-selection: I need a legend-click event so that I can send an HTTP request based on what the user selected. Currently, this feature is available in PieChart, where I can use the Relayout event to identify what the user clicked. But, I cannot get the same information with stacked-histograms. I also looked into the legend-click event for stacked-histogram, but I did not succeed.

  2. stacked-bar-click-event: If the user clicks on some stacked bar, I would like to identify which stacked element the user clicked on. For example, if I have 3 items stacked in a single bar, and the user clicks on the top-most element, I would like to get this information via the click-event, so that I can send an HTTP request.

I'm using this library in ReactJS, will the Plotly.js also update the ReactJS package, any suggestion on this?

Thank you very much for your help and the wonderful library!

Regards,
Adnan
stacked-1
stacked-2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions