Skip to content

Commit

Permalink
const -> let
Browse files Browse the repository at this point in the history
  • Loading branch information
plainheart committed Feb 27, 2024
1 parent 5f5bcaa commit 059dbde
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion contents/en/basics/release-note/5-5-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ If you need to use this solution, the server-side code remains the same, but you
const echarts = require('echarts');

// In SSR mode the first container parameter is not required
const chart = echarts.init(null, null, {
let chart = echarts.init(null, null, {
renderer: 'svg', // must use SVG rendering mode
ssr: true, // enable SSR
width: 400, // need to specify height and width
Expand Down
8 changes: 4 additions & 4 deletions contents/en/how-to/cross-platform/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ We introduced a new zero-dependency server-side string based SVG rendering solut
const echarts = require('echarts');

// In SSR mode the first container parameter is not required
const chart = echarts.init(null, null, {
let chart = echarts.init(null, null, {
renderer: 'svg', // must use SVG rendering mode
ssr: true, // enable SSR
width: 400, // need to specify height and width
Expand All @@ -47,7 +47,7 @@ chart.setOption({
// Output a string
const svgStr = chart.renderToSVGString();

// If chart is no longer useful, consider dispose it to release memory.
// If chart is no longer useful, consider disposing it to release memory.
chart.dispose();
chart = null;
```
Expand Down Expand Up @@ -108,7 +108,7 @@ echarts.setCanvasCreator(() => {

const canvas = createCanvas(800, 600);
// ECharts can use the Canvas instance created by node-canvas as a container directly
const chart = echarts.init(canvas);
let chart = echarts.init(canvas);

// setOption as normal
chart.setOption({
Expand All @@ -117,7 +117,7 @@ chart.setOption({

const buffer = renderChart().toBuffer('image/png');

// If chart is no longer useful, consider dispose it to release memory.
// If chart is no longer useful, consider disposing it to release memory.
chart.dispose();
chart = null;

Expand Down
2 changes: 1 addition & 1 deletion contents/zh/basics/release-note/5-5-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Apache ECharts 功能强大,相应地,包体积也比较大。我们在之
const echarts = require('echarts');

// 在 SSR 模式下第一个参数不需要再传入 DOM 对象
const chart = echarts.init(null, null, {
let chart = echarts.init(null, null, {
renderer: 'svg', // 必须使用 SVG 模式
ssr: true, // 开启 SSR
width: 400, // 需要指明高和宽,如果是根据客户端容器大小动态的,该值需要从客户端得到
Expand Down
4 changes: 2 additions & 2 deletions contents/zh/how-to/cross-platform/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
const echarts = require('echarts');

// 在 SSR 模式下第一个参数不需要再传入 DOM 对象
const chart = echarts.init(null, null, {
let chart = echarts.init(null, null, {
renderer: 'svg', // 必须使用 SVG 模式
ssr: true, // 开启 SSR
width: 400, // 需要指明高和宽
Expand Down Expand Up @@ -108,7 +108,7 @@ echarts.setCanvasCreator(() => {

const canvas = createCanvas(800, 600);
// ECharts 可以直接使用 node-canvas 创建的 Canvas 实例作为容器
const chart = echarts.init(canvas);
let chart = echarts.init(canvas);

// 像正常使用一样 setOption
chart.setOption({
Expand Down

0 comments on commit 059dbde

Please sign in to comment.