Skip to content

Commit

Permalink
Fixed #6769, hidden series legend had invalid stroke-width attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
TorsteinHonsi committed May 26, 2017
1 parent 6b8b3ef commit d542b6c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
5 changes: 1 addition & 4 deletions js/parts/Legend.js
Expand Up @@ -134,12 +134,9 @@ Highcharts.Legend.prototype = {

// Apply marker options
if (markerOptions && legendSymbol.isMarker) { // #585
//symbolAttr.stroke = symbolColor;
symbolAttr = item.pointAttribs();
if (!visible) {
H.objectEach(symbolAttr, function (val, key) {
symbolAttr[key] = hiddenColor;
});
symbolAttr.stroke = symbolAttr.fill = hiddenColor; // #6769
}
}

Expand Down
29 changes: 29 additions & 0 deletions samples/unit-tests/legend/legend-general/demo.js
Expand Up @@ -34,3 +34,32 @@ QUnit.test('Spacing and legend overflow (#6497)', function (assert) {
'Legend is within spacing'
);
});

QUnit.test('Hidden legend bogus SVG (#6769', function (assert) {

var chart = Highcharts.chart('container', {
credits: {
enabled: false
},
title: {
text: ''
},
yAxis: {
visible: false
},
xAxis: {
visible: false
},
series: [{
data: [1],
visible: false
}]
});

assert.strictEqual(
chart.container.innerHTML.indexOf('stroke-width="#'),
-1,
'No bogus stroke-width found'
);

});

0 comments on commit d542b6c

Please sign in to comment.