I am working on a nodejs web application, using the template engine of ejs. Now I want to get a chart, using Baidu’s echarts. At first, I can get the data out and put it into echarts to generate a chart. However, once the service is restarted, there will be a bug. Paste the code I wrote. After the service is restarted, the error is my incomes variable undefined. However, it was written at the beginning that there was no problem. After restarting the service, I asked you what the problem was.
Just look at the front-end code can’t see, the back-end nodejs processing function posted to see? It is better to post the wrong output as well.