I am trying to make use of the display:none and display:block on my website. The style as follows:
<style>
.div_class {
display: none;
}
</style>
The body content is:
<div class="div_class">
<div id="graph_id"></div>
</div>
The script is:
<script>
// some event occurs and sets the display property of div_class to block as follows
$(".div_class").css('display','block');
var BarGraph = echarts.init(document.getElementById('graph_id'), theme);
BarGraph.setOption({
// properties that are set for the echart 'graph_id'
});
</script>
The display: block;
makes the div visible but the echart properties that are set do not render. The div appears blank. What may be the reason? I am unable to figure out. Kindly help. Thanks :)
*************************** EDIT *************************************
Also, I think the title may be misleading, since I am able to hide the div onload and display it on click. But the later rendering is where I am facing certain issue.