I have a button for clicking to open a modal and after opening the modal I want to show the Echarts in the modal but it doesn't show on the modal. Please advise me what should I do or am I doing something wrong.
type script
async detail_modal() {
$("#detail").on('show.bs.modal', async() => {
this.options_type.series[0].data =[{name:'test',value:10}]
let myChart = echarts.init(document.getElementById('stock')!);
if (myChart) {
myChart.setOption(this.options_type, true);
}
});
}
HTML
<div class="modal fade" id="detail">
<div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable"
role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span>×
</span>
</button>
</div>
<div class="modal-body">
<div class="container">
<div id="stock" echarts [options]="options_type" class="demo-chart">
</div>
</div>
</div>
</div>
</div>
</div>
CSS
.demo-chart{
height: 200px;
}