diff --git a/docs/notes/theme/guide/chart/echarts.md b/docs/notes/theme/guide/chart/echarts.md index 9194f007..553afd5c 100644 --- a/docs/notes/theme/guide/chart/echarts.md +++ b/docs/notes/theme/guide/chart/echarts.md @@ -64,7 +64,7 @@ export default defineUserConfig({ 如果你需要通过脚本来获取数据,你可以使用 js 和 javascript 的代码块。 -我们将通过 `myChart` 变量暴露 Echarts 实例,并且你应该将 Echart 配置赋值给 `option` 变量。 +我们将通过 `echarts` 变量暴露 Echarts 实例,并且你应该将 Echart 配置赋值给 `option` 变量。 同时,你也可以赋值 `width` 和 `height` 来设置图表大小。 ````md diff --git a/docs/notes/theme/snippet/echarts-1.snippet.md b/docs/notes/theme/snippet/echarts-1.snippet.md index 02e104dc..8adf2cd8 100644 --- a/docs/notes/theme/snippet/echarts-1.snippet.md +++ b/docs/notes/theme/snippet/echarts-1.snippet.md @@ -81,14 +81,14 @@ const option = { ], } const timeId = setInterval(() => { - if (myChart._disposed) + if (echarts._disposed) return clearInterval(timeId) for (let i = 0; i < 5; i++) { data.shift() data.push(randomData()) } - myChart.setOption({ + echarts.setOption({ series: [ { data, diff --git a/docs/notes/theme/snippet/echarts-2.snippet.md b/docs/notes/theme/snippet/echarts-2.snippet.md index 2b89c71a..3513fb73 100644 --- a/docs/notes/theme/snippet/echarts-2.snippet.md +++ b/docs/notes/theme/snippet/echarts-2.snippet.md @@ -60,13 +60,13 @@ function run() { for (let i = 0; i < data.length; i++) data[i] += Math.round(Math.random() * Math.random() > 0.9 ? 2000 : 200) - myChart.setOption({ + echarts.setOption({ series: [{ type: 'bar', data }], }) } const timeId = setInterval(() => { - if (myChart._disposed) + if (echarts._disposed) return clearInterval(timeId) run()