-
Notifications
You must be signed in to change notification settings - Fork 729
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
Can you add event handlers to a VX linegraph? #328
Comments
yup! onClick={data => event => console.log('click')} |
@hshoff Thanks for the quick reply! Is there a way to isolate the point that I click on? Because if I do
|
Ah I see, it takes a bit more work to make that work on a LinePath. Check out this tutorial from @browniefed and the tooltip section for mapping an event position to a data point https://codedaily.io/tutorials/39/Make-a-Beautiful-Interactive-Bitcoin-Price-Chart-with-React-D3-and-VX#Tooltip-Handler |
It doesn't work in recent vx version. It worked in @vx/shape 0.0.179, but it seems doesn't work in 0.0.184. This is full code. |
@Achilles718611 Correct, there was a breaking change in v0.0.181 for details please see: #383 - onClick={data => event => this._handleLineSelect(event)}
+ onClick={event => this._handleLineSelect(event)} |
Thanks for your kind reply. |
<LinePath
data={data[key]}
// ...
onClick={event => {
console.log('my data', data[key]);
this._handleLineSelect(event);
}}
/> |
data is object which is consist of key and value(array). |
Here's an example of how to accomplish this: https://codesandbox.io/s/bitcoinchart-syeeo?fontsize=14&module=%2Fsrc%2FApp.js |
Got it.
Thank you.
…On Wed, May 22, 2019 at 12:00 AM Harrison Shoff ***@***.***> wrote:
Here's an example of how to accomplish this:
https://codesandbox.io/s/bitcoinchart-syeeo?fontsize=14&module=%2Fsrc%2FApp.js
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#328>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHS6YUTDS37524DLCGQKW63PWQMB7ANCNFSM4FNCJBGQ>
.
|
No description provided.
The text was updated successfully, but these errors were encountered: