I am currently working on integrating a highchart demo into a backbone.js widget.
The HighChart Demo is not rendering properly within my widget, even though the template generates everything else correctly. It seems that there might be an issue with highchart rendering to a div that has not yet been added to the DOM, as I am able to add the chart afterwards.
Does anyone have any suggestions on how to add the chart widget to the tree during the render cycle?
window.HomeView = Backbone.View.extend({
initialize:function () {},
render:function () {
$(this.el).html(this.template());
var chart = $("#chart", this.el)[0];
this.renderChart(chart);
return this;
},
renderChart: function(container) {
// Highchart data and rendering code goes here
}
});
My current workaround involves triggering an event that initiates a post-render cycle, but this is not an ideal solution.