hlbj105 opened a new issue #10673: 在vue 中 heatmap 按需加载 报TypeError: Cannot read property 'get' of undefined URL: https://github.com/apache/incubator-echarts/issues/10673 ### Version 4.2.1 ### Reproduction link [https://gallery.echartsjs.com/editor.html?c=xq9GwW2vNP&v=1](https://gallery.echartsjs.com/editor.html?c=xq9GwW2vNP&v=1) ### Steps to reproduce ``` <template> <div id="heatmapId" style="width: 100%;height: 600px;" /> </template> <script> // 引入 ECharts 主模块 const echarts = require('echarts/lib/echarts') // 引入热力图 require('echarts/lib/chart/heatmap') require('echarts/lib/component/visualMap') export default { data() { return { } }, mounted() { this.initChart() }, methods: { initChart() { // 基于准备好的dom,初始化echarts实例 var dom = document.getElementById('heatmapId') // 下面复制官方例子 var myChart = echarts.init(dom) var app = {} var option = null app.title = '笛卡尔坐标系上的热力图' var hours = ['12a', '1a', '2a', '3a', '4a', '5a', '6a', '7a', '8a', '9a', '10a', '11a', '12p', '1p', '2p', '3p', '4p', '5p', '6p', '7p', '8p', '9p', '10p', '11p'] var days = ['Saturday', 'Friday', 'Thursday', 'Wednesday', 'Tuesday', 'Monday', 'Sunday'] var data =[] // 具体看重现连接,这里太长新建不了issue data = data.map(function(item) { return [item[1], item[0], item[2] || '-'] }) option = { tooltip: { position: 'top' }, animation: false, grid: { height: '50%', y: '10%' }, xAxis: { type: 'category', data: hours, splitArea: { show: true } }, yAxis: { type: 'category', data: days, splitArea: { show: true } }, visualMap: { min: 0, max: 10, calculable: true, orient: 'horizontal', left: 'center', bottom: '15%' }, series: [{ name: 'Punch Card', type: 'heatmap', data: data, label: { normal: { show: true } }, itemStyle: { emphasis: { shadowBlur: 10, shadowColor: 'rgba(0, 0, 0, 0.5)' } } }] } if (option && typeof option === 'object') { myChart.setOption(option, true) } } } } </script> ``` ### What is expected? 是少引入什么包吗 ### What is actually happening? 怎么解决呢? <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
