Cannot read property ‘get‘ of undefined

When I was working on a WeChat applet, I wanted to optimize the page because I wanted to participate in a competition. I found a visualization tool like ECharts on the Internet. I found it good and used it.

Read other people's blogs to explain, select the charts you need to package and download, otherwise the mini program js will be too large to be uploaded. So, I found the three icons I wanted to use on the official website, as shown below.

3a9fcdadf674473c9fc01535bcf71239.png

When debugging in the developer tools, the pie chart can be displayed completely. However, when I run the line chart against other people's code, I always get the error Cannot read property 'get' of undefined.

a72bb20dc7fc401ab430857ec4e68570.png

 After searching on the Internet for a long time, most people said that "there is a problem with the passed value, the format is wrong, please carefully look at the code in your options and whether the format is correct with the official website." I turned on the multi-window mode and compared it for a long time. I deleted a bunch of code that I thought was useless, but it still didn’t work, damn!

As I looked at it, it suddenly occurred to me that I still didn’t know what the title, legend, tooltip, etc. in the option were.

d2f7aff1cfc948fd91e9b63d3df921a5.png

 I accidentally turned to the official website built by echarts online. The English below the chart is the words in the options!

3dd6aeb29ac64815b8f01b934a1bed34.png

 Okay, now I understand. In order to reduce the size of js, I did not package components such as title and legend. Now go to the official website to download it and run it in the developer tools to see it, nice!

cdf044dd4e3942849b5a3e55c271dcc7.png

 

 

 

Guess you like

Origin blog.csdn.net/m0_63080216/article/details/130814564