Skip to content

Commit

Permalink
Partial fix for bug #284; Series rgba color and tooltip border
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Olsson committed Aug 11, 2011
1 parent 0e6c668 commit 8ed2ee0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
3 changes: 3 additions & 0 deletions js/highcharts.src.js
Expand Up @@ -2845,6 +2845,9 @@ SVGRenderer.prototype = {


} else {
// Remove the opacity attribute added above. Does not throw if the attribute is not there.
elem.removeAttribute(prop + '-opacity');

return color;
}

Expand Down
3 changes: 3 additions & 0 deletions js/parts/SvgRenderer.js
Expand Up @@ -1323,6 +1323,9 @@ SVGRenderer.prototype = {


} else {
// Remove the opacity attribute added above. Does not throw if the attribute is not there.
elem.removeAttribute(prop + '-opacity');

return color;
}

Expand Down
18 changes: 18 additions & 0 deletions test/unit/RendererTest.js
Expand Up @@ -47,3 +47,21 @@ RendererTest.prototype.testCssFontSize = function () {
assertUndefined(undefinedFontSize + ' should be undefined', textElement.styles[undefinedFontSize])
assertEquals('Changed font size', '21px', textElement.styles[definedFontSize]);
}

RendererTest.prototype.testTransparancy = function () {
var rect = this.renderer.rect(100, 100, 100, 100, 5);

// Set the stroke to a transparent color
rect.attr({
'stroke-width': 2,
stroke: 'rgba(255,255,255,0)'
});

// Set it back to a solid color
rect.attr({
stroke: '#aabbcc'
});

// Make sure there is no stray opacity
assertFalse('There is a stray opacity value', rect.element.hasAttribute('stroke-opacity'));
}
1 change: 0 additions & 1 deletion test/unit/UtilitiesTest.js
Expand Up @@ -163,7 +163,6 @@ UtilTest.prototype.testPlaceBox = function () {
dataPoint.y = 5;
boxPoint = placeBox(tooltipSize.width, tooltipSize.height, chartRect.x, chartRect.y, chartRect.width, chartRect.height, dataPoint);
extend(boxPoint, tooltipSize);
jstestdriver.console.log(boxPoint.x + ',' + boxPoint.y + ', ' + boxPoint.width + ',' + boxPoint.height);
assertTrue('TopRight rectInRect chart', this.rectInRect(boxPoint, chartRect));
assertFalse('TopRight tooltip cover point', this.pointInRect(dataPoint.x, dataPoint.y, boxPoint));
};
Expand Down

0 comments on commit 8ed2ee0

Please sign in to comment.