tremor icon indicating copy to clipboard operation
tremor copied to clipboard

Feature Request: Add ability to filter out data based on clicking legend

Open bernsno opened this issue 2 years ago • 2 comments

It can frequently be valuable to filter down data in your chart to compare certain categories against one another. I think the natural place to do such filter on many charts is in the Legend component. By providing the option to pass a function to the Legend component dashboard creators would be given the capability to define functionality to filter their data as needed.

I've created a PR in draft state as a conversation starter as this enabling this functionality will require more than a couple changes in any component that renders the legend, and may have implications regarding the connection that's expected b/w categories and data in most chart components.

bernsno avatar Mar 25 '23 04:03 bernsno

Thank you @bernsno, your request makes sense to me. We will review this internally. Thanks for contributing!

severinlandolt avatar Apr 17 '23 19:04 severinlandolt

I intended to open an issue to request the feature but found this one.

it's really important to have this possibility, and in all types of charts. depending on the number of categories, it is interesting to be able to compare only specific labels, selected by the user.

devmanbr avatar May 19 '23 03:05 devmanbr

Thanks for the discussion! https://github.com/tremorlabs/tremor/pull/711

severinlandolt avatar Sep 26 '23 19:09 severinlandolt