In my Rails project, I have an Highchart(Line chart) Initialized and plot in a partial/view. I want to append this chart to a bootstrap modal. I have tried multiple methods but nothing seems worked out.
But the chart is plotting without bootstrap modal AND bootstrap modal is working without chart, But both are not working together.
my method.js.erb
var graphModal = $('#view-graph-modal');
var graphModalBody = graphModal.find('.modal-body');
graphModal.on('shown',function(){
graphModalBody.append("<%= j render(:partial => '/projects/partials/graph',:formats => [:html]) %>");
});
graphModal.modal("show");
graph partial has my highchart.
Is it proper way to append whole view? Or is there any better way to only append the chart.
Any help would be appreciated! TIA