I'm triing to draw a dimple.js svg bar chart, which is nested in jquery-ui tabs and accordeon, which I use for my website layout and I get pretty desperate. Everything works fine in Chrome and IE, but FF keeps throwing NS_ERROR_FAILURE exception. Here is the code snippet:
function drawDimpleChart(){
d3.json("synkon-dat.php", function (data) {
var svg = dimple.newSvg("#graph-txttypy-d3", 590, 400);
var myChart = new dimple.chart(svg, data);
myChart.setBounds(100, 70, 480, 150);
myChart.addPctAxis("x", "ratio");
myChart.addCategoryAxis("y", "kategorie");
myChart.addSeries("varianta", dimple.plot.bar);
myChart.addLegend(200, 10, 380, 20, "right");
myChart.draw();
});
}
$(document).ready(function() {
$("#tabs").tabs();
$(".accordion").accordion({ active: 'none', clearStyle: true });
drawDimpleChart();
});
I've realized that the issue is related to the order in which jquery and the drawing function are executed. When I call jquery in the callback after the .draw method, everything works, but I realy need the tabs to show before all the data comes back (this can take some time).
Please help, what do I miss?