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(Highcharts): fix resetZoomButton styles #137

Merged
merged 1 commit into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/plugins/highcharts/renderer/helpers/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -1753,6 +1753,20 @@ export function prepareConfig(data, options, isMobile, holidays) {
return Highcharts.Axis.prototype.defaultLabelFormatter.call(this);
},
},
events: {
setExtremes: function () {
// There is no better way to align zoom button text
// Callback setExtremes used because of it obligatory invocation on every zoom event
// setTimeout used because of absence resetZoomButton node in dom on first zoom event
setTimeout(() => {
const text = this.chart.resetZoomButton?.text;

if (text) {
text.translate(0, -6);
}
}, 0);
},
},
},
yAxis: {
crosshair: options.splitTooltip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,15 @@ Highcharts.setOptions({
resetZoomButton: {
relativeTo: 'chart',
theme: {
width: 16,
height: 16,
r: 6,
width: 12,
height: 12,
'text-align': 'center',
opacity: '0.8',
cursor: 'pointer',
style: {
fontSize: '20px',
},
},
position: {
y: 30,
Expand Down