-
Notifications
You must be signed in to change notification settings - Fork 0
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
created pie charts with synced tooltips and common legend #13
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, I really like this solution!
H.Tooltip.prototype.hide = function (delay) { | ||
const otherTooltips = this.chart.otherTooltips, | ||
tooltip = this; | ||
U.clearTimeout(tooltip.hideTimer); | ||
delay = pick(delay, tooltip.options.hideDelay); | ||
if (!tooltip.isHidden) { | ||
tooltip.hideTimer = syncTimeout(function () { | ||
otherTooltips.forEach((t) => { | ||
t.getLabel().fadeOut(delay ? void 0 : delay); | ||
t.isHidden = true; | ||
}); | ||
tooltip.getLabel().fadeOut(delay ? void 0 : delay); | ||
tooltip.isHidden = true; | ||
}, delay); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also just use the point.mouseOver
option event, but it's also a very nice solution.
chart.otherTooltips = chart.series.slice(1).map(() => new Highcharts.Tooltip( | ||
chart, Highcharts.merge(chart.options.tooltip) | ||
) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that you foresee the possibility of additional synchronized series.
No description provided.