Skip to content

Instantly share code, notes, and snippets.

@alexkasko
Created November 26, 2014 10:42
Show Gist options
  • Save alexkasko/f42618dc5077944be5d6 to your computer and use it in GitHub Desktop.
Save alexkasko/f42618dc5077944be5d6 to your computer and use it in GitHub Desktop.
Dojo gfx toSVG pie chart in IE8 example
<!DOCTYPE html>
<html>
<head>
<title>toSVG problem in IE8</title>
<script src="dojo-latest/dojo/dojo.js" data-dojo-config="isDebug: 1, async: 1, parseOnLoad: 0"></script>
<script>
require([
"dojox/charting/Chart",
"dojox/charting/plot2d/Pie",
"dojox/gfx/utils",
"dojo/domReady!"
], function (Chart, Pie, utils) {
var chart = new Chart("mychart")
.addPlot("default", {type: Pie, labels: false})
.addSeries("default", [1, 1])
.render();
setTimeout(function () {
alert("Firing toSVG");
utils.toSvg(chart.surface).then(
function (svg) {
alert(svg);
},
function (error) {
alert("Error occurred: " + error);
});
}, 1000);
});
</script>
</head>
<body>
<div id="mychart" style="width:640px; height:480px;"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment