import ReactEcharts from 'echarts-for-react' 当包含此组件的页面返回时,会报错”TypeError: Cannot read property 'hide' of undefined“,但是并没有使用hide 相关的函数,查找不到错误点。
const trendoption = { width: '100%', height: '50%', color: '#00AEFF', grid: { // top: '50%', left: '-3%', right: '0%', bottom: '20%', containLabel: true, }, xAxis: [ { type: 'category', axisLine: { show: false, }, axisTick: { show: false, }, data: [m11, m22, m33], }, ], yAxis: [ { type: 'value', show: false, }, ], tooltip : { trigger: 'axis', axisPointer : { type : 'shadow' } }, series: [ { label: { normal: { show: true, position: 'top', }, }, name: ['Count'], type: 'bar', width: '100%', symbolSize: 20, data: [m1, m2, m3], }, ], }
const option = { tooltip: { show: false, trigger: 'item' }, color: '#00AEFF', radar: { name: { textStyle: { color: '#999', borderRadius: 3, padding: [5, 3], }, }, indicator: [ { name: 'T', max: 100 }, { name: 'Q', max: 100 }, { name: 'R', max: 100 }, { name: 'D', max: 100 }, { name: 'C', max: 100 }, ], }, grid: { x: 50, y: 50, x2: 50, y2: 50, }, series: [{ type: 'radar', splitLine: { lineStyle: { type: 'dashed' } }, label: { normal: { show: true, position: 'top', }, }, splitArea: { show: false }, lineStyle: { color: '#00AEFF' }, data: [ { name: title, value: data, }, ], }], }
What is expected? 希望当跳转页面时,Charts并不会报错‘hide’
What is actually happening? 实际上报错了。TypeError: Cannot read property 'hide' of undefined
该提问来源于开源项目:hustcc/echarts-for-reac