echarts 多图联动官方示例 图不能显示

echarts官方示例 运行图表不显示 所用示例为:联动和共享数据集

img

图二 显示结果

img

代码如下:


```javascript
mounted () { this.intChartLineAndPie() }, intChartLineAndPie () { const chartDom = document.getElementById('main') let myChart = echarts.init(chartDom) let option setTimeout(function () { option = { legend: {}, tooltip: { trigger: 'axis', showContent: false }, dataset: { source: [ ['product', '2012', '2013', '2014', '2015', '2016', '2017'], ['Milk Tea', 56.5, 82.1, 88.7, 70.1, 53.4, 85.1], ['Matcha Latte', 51.1, 51.4, 55.1, 53.3, 73.8, 68.7], ['Cheese Cocoa', 40.1, 62.2, 69.5, 36.4, 45.2, 32.5], ['Walnut Brownie', 25.2, 37.1, 41.2, 18, 33.9, 49.1] ] }, xAxis: { type: 'category' }, yAxis: { gridIndex: 0 }, grid: { top: '55%' }, series: [ { type: 'line', smooth: true, seriesLayoutBy: 'row', emphasis: { focus: 'series' } }, { type: 'line', smooth: true, seriesLayoutBy: 'row', emphasis: { focus: 'series' } }, { type: 'line', smooth: true, seriesLayoutBy: 'row', emphasis: { focus: 'series' } }, { type: 'line', smooth: true, seriesLayoutBy: 'row', emphasis: { focus: 'series' } }, { type: 'pie', id: 'pie', radius: '30%', center: ['50%', '25%'], emphasis: { focus: 'self' }, label: { formatter: '{b}: {@2012} ({d}%)' }, encode: { itemName: 'product', value: '2012', tooltip: '2012' } } ] } myChart.on('updateAxisPointer', function (event) { const xAxisInfo = event.axesInfo[0] if (xAxisInfo) { const dimension = xAxisInfo.value + 1 myChart.setOption({ series: { id: 'pie', label: { formatter: '{b}: {@[' + dimension + ']} ({d}%)' }, encode: { value: dimension, tooltip: dimension } } }) } }) myChart.setOption(option) }) }

显示结果如图2: 其中chartDom myChart option都能取到  就是图不能显示 单纯折线图与饼图都能显示
求大神们解答

望采纳
echarts版本不兼容,请检查你的echarts版本是否与你使用的manim版本兼容

我建议您看一下官方完整代码,官方使用的是函数作用域var进行对echarts的初始化,而您使用的是块作用域let,不知道是不是这个问题

想问问题主问题解决了没,我今天也是用了这个模板,但是我在调用时出现的问题是,

img

如上图

也就是饼状图的formatter格式中{b}部分无法正常显示,同时也不能通过图例控制饼状图