Skip to content

Commit

Permalink
Merge pull request #123 from adelamarAtGalileo/fix-chart-event-sync
Browse files Browse the repository at this point in the history
Fix chart event sync
  • Loading branch information
nategrift committed Aug 17, 2023
2 parents cc18066 + f77feda commit 3472217
Showing 1 changed file with 8 additions and 1 deletion.
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

0 comments on commit 3472217

Please sign in to comment.