Closed Shakarhaba closed 4 years ago
Hey three, I think that would be awesome! However, I didn't have the time to think about what would be the best way to achieve this. If you got an idea it would be highly appreciated. Best Christoph
Hi @Shakarhaba, I've forked the project and added the feature, if you want to try check it out!
You can add this code on chart options
prop:
dragOptions: {
magnet: {
to: Math.round
}
}
I've tested on linear chart
only, so I don't know the behaviour on a pie chart for instance.
Thanks a lot @velthune for the great implementation ❤️ I hope this is what @Shakarhaba was looking for, in any way it's a great addition. Will close this for now, please re-open if this doesn't answer the issue.
As you might know, we can set the mode 'nearest' to trigger the hover action of the points and the tooltips.
It would be perfect that the drag action would work once the point is activated with the 'nearest' mode instead of actually needing to hover over the point.
Thank you