Skip to content
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

Change default selecter bar between data #317

Open
carlosriveroib opened this issue Jul 17, 2024 · 0 comments
Open

Change default selecter bar between data #317

carlosriveroib opened this issue Jul 17, 2024 · 0 comments

Comments

@carlosriveroib
Copy link

Question

How can I change the default selected bar if the data changes?

Background Info/Attempts

Hi, I have 3 buttons, each of them change de data of the chart. I know how to change the color on specific bar using useChartPressState, but when I press other button and the data changes I don't know how to update or select a specific bar with this new data.

On the other hand, let's suppose we have the following data:

[
  { "date": "2024-07-01", "temp": 24 }, 
  { "date": "2024-07-02", "temp": 25 }
]

X axis is date, why is necessary when using useChartPressState pass the Y value? If I pass the X key I will expect to get its Y value
useChartPressState({ x: "2024-07-01", y: { temp: 24 } })

Thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant