-
Notifications
You must be signed in to change notification settings - Fork 35
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
ApexCharts events not working with vue3 #20
Comments
Running into the same issue. I can listen to the vue @click event on the entire graph, but nothing that gives me context where the user clicks. |
Same issue here. Click, and even mousMove events are not working |
Its already turn into emit, so you can just use like @dataPointSelection instead. |
the solution that @sam585456525 gives is a good workaround imo. |
@sam585456525 I'm confused about what you are saying to do, could you please give us an example? |
Thanks for the explanation. |
there is no actual info about events in docs, but you should subscribe on events on component like |
So is this a bug, or should it be added to documentation somewhere? I was stuck trying to do it the way the documentation says. It could be added to the readme of this repo? |
Any news ? |
I would also be very interested in what the current situation is and how events should be used on VUE3 |
bump |
has anyone solved this, or we are still waiting for this to be solved? |
see the answer here #20 (comment) - it is a good solution. i use this approach when reacting to events from apex. can't say i have tried to put them directly in the options as per the docs. |
We're facing some event problems here as well. These emits are working fine for our bar charts, but how will they work on our pie charts? I can't get them to work with the @click events. Seems like the @dataPointSelection is working, but only when I click inside the legend from the pie charts. Any ideas how to get these working? |
have you tried using vue devtools event timeline to see what apex is emitting? |
Got the solution. It was an issue with another library. We're using SwiperJS for having some swipercards on the application. But because of this, the click events inside those swipercards didn't fire. The bar chart I was talking about, wasn't inside this swiper component. For the ones having this issue, using :touchStartPreventDefault="false" on the swipercard solves my issue. |
For anyone wondering how to get the data we clicked when we click the chart using dataPointSelection, from the config, we can get config.dataPointIndex, which should net us the index number. Together with our series for that chart, we can know which chart is press. eg
get idea from this website |
here's a PR to fix the chart options for "events", if anyone has feedback: #105 |
I've been trying to fire an event whenever someone clicks somewhere on the chart but I've been unable to do it with a vue3 project setup. My charts are showing fine but firing events does not work.
I've used the following code:
<apexchart type="rangeBar" width="500px" :options="chartOptions" :series="series"></apexchart>
Is anyone else having issues with events? Am I missing a piece of configuration? Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: