You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was the problem:
IE9: SVG text-anchor uses: "start, "middle", and "end"
... not "left" and "right"
see: http://www.w3.org/TR/SVG/text.html#AlignmentProperties
I have created a slightly hacky workaround, as a javascript snippit to be inserted before d3.js is loaded. Not extensively tested, and there may be a far more elegant solution available, but this was sufficient to get this successfully chart rendering on IE9.
(function() {
var d3_style_prototype = this.CSSStyleDeclaration.prototype;
var d3_style_setProperty = d3_style_prototype.setProperty;
d3_style_prototype.setProperty = function(name, value, priority) {
try {
d3_style_setProperty.call(this, name, value + "", priority);
} catch(exception) {
console.warn("d3_style_prototype.setProperty - name: ", name, ", value: ", value, ", priority: ", priority, ", exception: ", exception);
switch(name) {
case 'left': name = 'start'; break;
case 'right': name = 'end'; break;
default: name = 'middle'; break;
}
d3_style_setProperty.call(this, name, value + "", priority);
}
};
})();
The text was updated successfully, but these errors were encountered:
Yes, IE9 throws an error sometimes if you try to set an invalid style property. This is one of IE9’s quirks, and since D3 is not a compatibility layer, you’ll need to avoid invalid values when setting style properties.
Javascript Exception affects IE9 (Win7 under VMware Fusion)
Exception:
SCRIPT87: Invalid argument.
d3.js, line 41 character 9
The following is a test script which reproduces this bug:
A bit of googling and old discussion thread highlighted a similar past issue and potential fix
I have created a slightly hacky workaround, as a javascript snippit to be inserted before d3.js is loaded. Not extensively tested, and there may be a far more elegant solution available, but this was sufficient to get this successfully chart rendering on IE9.
The text was updated successfully, but these errors were encountered: