Skip to content

Commit

Permalink
Fixed #18928, tooltip not showing when one chart hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
TorsteinHonsi committed May 3, 2023
1 parent 1146308 commit b244da7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 35 deletions.
44 changes: 14 additions & 30 deletions samples/unit-tests/svgrenderer/shadows/demo.js
@@ -1,28 +1,18 @@
QUnit.test('Series shadows', function (assert) {
var chart = Highcharts.chart('container', {
series: [
{
shadow: {
color: 'red',
width: 10,
offsetX: 40,
offsetY: -20,
opacity: 0.05
},
data: [29, 71, 106, 129, 144]
}
]
}),
attributes = [
'stroke="blue"',
'stroke-opacity="0.2"',
'transform="translate(0, 20)'
],
defaultAttributes = [
'stroke="#000000"',
'stroke-opacity="0.15"',
'transform="translate(1, 1)'
];
series: [
{
shadow: {
color: 'red',
width: 10,
offsetX: 40,
offsetY: -20,
opacity: 0.05
},
data: [29, 71, 106, 129, 144]
}
]
});

chart.series[0].update({
shadow: {
Expand Down Expand Up @@ -50,7 +40,7 @@ QUnit.test('Series shadows', function (assert) {

assert.strictEqual(
chart.series[0].graph.attr('filter'),
'url(#drop-shadow)',
'url(#drop-shadow-0)',
'Shadows should be updated when old options defined as object and new as boolean (#12091).'
);

Expand All @@ -66,12 +56,6 @@ QUnit.test('Series shadows', function (assert) {
]
});

attributes = [
'stroke="red"',
'stroke-opacity="0.3"',
'transform="translate(10, 5)'
];

chart.series[0].update({
shadow: {
width: 20,
Expand Down
2 changes: 1 addition & 1 deletion ts/Core/Renderer/SVG/SVGRenderer.ts
Expand Up @@ -601,7 +601,7 @@ class SVGRenderer implements SVGRendererLike {
): string {
const
id = [
'drop-shadow',
`drop-shadow-${this.chartIndex}`,
...Object.keys(shadowOptions)
.map((key: string): number|string =>
(shadowOptions as any)[key]
Expand Down
10 changes: 6 additions & 4 deletions ts/Core/Utilities.ts
Expand Up @@ -1297,6 +1297,8 @@ function getStyle(
prop: string,
toInt?: boolean
): (number|string|undefined) {
const customGetStyle: typeof getStyle = (H as any).getStyle || getStyle;

let style: (number|string|undefined);

// For width and height, return the actual inner pixel size (#4913)
Expand All @@ -1322,8 +1324,8 @@ function getStyle(
0, // #8377
(
offsetWidth -
(getStyle(el, 'padding-left', true) || 0) -
(getStyle(el, 'padding-right', true) || 0)
(customGetStyle(el, 'padding-left', true) || 0) -
(customGetStyle(el, 'padding-right', true) || 0)
)
);
}
Expand All @@ -1333,8 +1335,8 @@ function getStyle(
0, // #8377
(
Math.min(el.offsetHeight, el.scrollHeight) -
(getStyle(el, 'padding-top', true) || 0) -
(getStyle(el, 'padding-bottom', true) || 0)
(customGetStyle(el, 'padding-top', true) || 0) -
(customGetStyle(el, 'padding-bottom', true) || 0)
)
);
}
Expand Down

0 comments on commit b244da7

Please sign in to comment.