-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[charts] Pass onClick
to chart item
#10549
Comments
hey @alexfauquette I have also been working on this one, But I was trying to implement it in a different way. I have tried to adopt the Lines Demo : https://codesandbox.io/s/misty-currying-z9nwrz?file=/src/Demo.tsx |
Hi @yaredtsy could you open a PR to see the entire file modification? |
The more I think about it, the more I wonder if it's not closely related to #9358 which would also move the mouse interaction from the scatter chart items to the svg component |
I would love to have this feature on scatter chart! It would ease the reading of data in the Tooltip with a fixed placed holder for example. Or we can use to select one item in the chart and compare it with the data in the tooltip. |
You can use color as reference of slice of pie chart (uniq color is id). example: <PieChart
colors={itemsWithColors.map((item) => item.color)}
series={[
{
data: itemsWithColors
}
]}
slotProps={{
pieArc: {
onClick: (e) => handleArcClick(e.target),
cursor: "pointer"
}
}}
width={400}
height={200}
/> |
@alexfauquette Just want to say thanks for working on this! This would be a huge improvement to one of our chart implementations. Appreciate you! |
@nico-martinucci Based on you use cases, do you have insight regarding the different option in the PR? |
Probably idea 2, but would love your thoughts - we have a summary graph, calculated from many many rows of raw data. That raw data is rolled up into months, weeks, or days depending on user-set filters. My hope is for a user to be able to click on one of the stacked bars (which represents a single month, week, or day) and this would navigate to a page with a table of the rows that were rolled-up into that particular bar. For example, clicking on "June '23" bar would take you to the table with only records from that month, or clicking on "June 13, 2023" would take you to a table of records just for that day. Ideally the |
Follow up to #10506
Allows to add
onClick
which should be triggered when clicking on an itemCharts todo
How
Follow #10506 to get inspiration. In short:
onClick
goes the the chart component and the plot componentsonClick
Search keywords:
The text was updated successfully, but these errors were encountered: