echart TypeError: Cannot read property 'currentStyle' of undefined
时间: 2023-08-27 14:11:24 浏览: 159
这个错误是由于尝试读取未定义属性'currentStyle'引起的。根据引用,currentStyle属性只有IE浏览器支持,其他浏览器都不支持。而你的代码中使用了currentStyle来获取元素的样式。因此,在非IE浏览器中,应该使用getComputedStyle()方法来获取元素的样式,如引用所示。你可以尝试将代码中的获取元素样式的部分替换为getComputedStyle()方法,这样就可以解决该错误。例如,使用getComputedStyle(box1, null)[name来替代box1.currentStyle[name。<em>1</em><em>2</em><em>3</em>
#### 引用[.reference_title]
- *1* [ECharts——运行错误[TypeError: Cannot read property ‘type‘ of undefined]解决方案](https://blog.csdn.net/weixin_43272781/article/details/123961543)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}} ] [.reference_item]
- *2* *3* [Cannot read property ‘width‘ of undefined](https://blog.csdn.net/m0_49416118/article/details/117954032)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}} ] [.reference_item]
[ .reference_list ]
阅读全文