Skip to content
Browse files

Partial fix for bug #284; Series rgba color and tooltip border

  • Loading branch information...
1 parent 0e6c668 commit 8ed2ee073ca3b15d7e645b48ffe91654583d27ca @eolsson eolsson committed Aug 11, 2011
Showing with 24 additions and 1 deletion.
  1. +3 −0 js/highcharts.src.js
  2. +3 −0 js/parts/SvgRenderer.js
  3. +18 −0 test/unit/RendererTest.js
  4. +0 −1 test/unit/UtilitiesTest.js
View
3 js/highcharts.src.js
@@ -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;
}
View
3 js/parts/SvgRenderer.js
@@ -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;
}
View
18 test/unit/RendererTest.js
@@ -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'));
+}
View
1 test/unit/UtilitiesTest.js
@@ -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));
};

0 comments on commit 8ed2ee0

Please sign in to comment.
Something went wrong with that request. Please try again.