Data loading problems using echarts and datatables

When the

page is initialized, because the data has not been fully requested, but the chart has been loaded and the data binding is not up, how to solve this problem? The current solution is to set a timer to request every 1 second until the data is requested, and then load the chart, but this method will keep requesting when there is no data, the timer can not be controlled, and the server is prone to explosion. Is there any better way? ask the boss for guidance.


load the chart setOption after getting the data

Menu