DianaYako opened a new issue, #19471: URL: https://github.com/apache/echarts/issues/19471
### Version 5.4.3 ### Link to Minimal Reproduction http://39.107.103.152/green-soil-hd/#/home ### Steps to Reproduce 直接进入就直接报错了  ### Current Behavior 进入就直接报错这个,我在初始化后直接就setOption了 ### Expected Behavior 不报错 ### Environment ```markdown - OS: windows - Browser: chrome latest - Framework: vue3 ``` ### Any additional comments? 这是我的代码 报错代码目标位 ``` mapInstance = echarts.init(mapRef.value); mapInstance.setOption(option) ``` option 参数 第一次使用的就是这个配置进行setOption的 直接就报错了 ``` const option: EChartsOption = { tooltip: { trigger: 'item' }, bmap: { center: [117.71619, 39.059451], zoom: 14, roam: true }, visualMap: { show: true, bottom: '50%', orient: 'vertical', left: "20", min: 6, max: 9, seriesIndex: 0, calculable: true, inRange: { color: ['green', 'yellow', 'red'] // range:[1,100] }, textStyle: { color: '#333' // 图例的文字颜色 } }, series: [{ type: 'heatmap', coordinateSystem: 'bmap' as any, }] } ``` ``` <!-- --> <template> <div class="map-container"> <div class="map-ins" ref="mapRef"></div> </div> </template> <script setup lang="ts"> import * as echarts from 'echarts/core'; import { TitleComponent, TitleComponentOption, TooltipComponent, TooltipComponentOption } from 'echarts/components'; import { ScatterChart, ScatterSeriesOption, EffectScatterChart, EffectScatterSeriesOption, HeatmapChart, HeatmapSeriesOption } from 'echarts/charts'; import { UniversalTransition } from 'echarts/features'; import { CanvasRenderer } from 'echarts/renderers'; import 'echarts/extension-src/bmap/bmap'; echarts.use([TitleComponent, TooltipComponent, ScatterChart, EffectScatterChart, CanvasRenderer, UniversalTransition, HeatmapChart]); type EChartsOption = echarts.ComposeOption< | TitleComponentOption | TooltipComponentOption | ScatterSeriesOption | EffectScatterSeriesOption | HeatmapSeriesOption >; const mapRef = ref<HTMLElement>() const option: EChartsOption = { tooltip: { trigger: 'item' }, bmap: { center: [117.71619, 39.059451], zoom: 14, roam: true }, visualMap: { show: true, bottom: '50%', orient: 'vertical', left: "20", min: 6, max: 9, seriesIndex: 0, calculable: true, inRange: { color: ['green', 'yellow', 'red'] // range:[1,100] }, textStyle: { color: '#333' // 图例的文字颜色 } }, series: [{ type: 'heatmap', coordinateSystem: 'bmap' as any, }] } let mapInstance: echarts.ECharts const renderChart = (o: any) => { let r = () => { if (mapInstance) { console.log(option) mapInstance.setOption(o) // mapInstance.setOption(option) } else { setTimeout(() => { r() }, 100); } } r() } const initChart = () => { mapInstance = markRaw(echarts.init(mapRef.value)); mapInstance.setOption(option) } const setData = (flag: number, dataT: KeyValue) => { renderChart({ visualMap: { min: flag === 1 ? 6 : 0, max: flag === 1 ? 9 : 1 }, series: [{ pointSize: flag === 1 ? 15 : 30, blurSize: flag === 1 ? 15 : 20, data: dataT }] }) } const showLoading = () => { if (mapInstance) { mapInstance.showLoading({ text: '加载中', maskColor: 'rgba(184, 219, 255, .5)', textColor: '#fff' }) } } const hideLoading = () => { if (mapInstance) { mapInstance.hideLoading() } } onMounted(() => { initChart() }) defineExpose({ setData, showLoading, hideLoading }) </script> <style scoped lang="scss"> .map-container { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background-color: #fff; .map-ins { width: 100%; height: 100%; } } </style> ``` -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
