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

Fix chart event sync #123

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/trace.js
Expand Up @@ -152,12 +152,19 @@ export default {
}


// do not transmit click events to prevent unwanted changing of synced
// charts. We do need to transmit an event to stop zooming on synced
// charts however.
var eventType = e.original.type == "click" ? "mousemove" : e.original.type;

var newEvent = {
type: e.original.type == "click" ? "mousemove" : e.original.type, // do not transmit click events to prevent unwanted changing of synced charts. We do need to transmit a event to stop zooming on synced charts however.
type: eventType,
chart: chart,
x: xScale.getPixelForValue(e.xValue),
y: e.original.y,
native: {
// ChartJS filters events to plugins by the event's native type
type: eventType,
buttons: buttons
},
stop: true
Expand Down