Skip to content

Commit 743142e

Browse files
author
Echo
committed
docs: add English version demo and fix the problems requested by the reviewer
1 parent 4e77568 commit 743142e

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

docs/assets/examples/en/pictogram-chart/pictogram-mall.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ group: pictogram chart
44
title: SVG Shopping Mall Tenant Layout
55
keywords: pictogramChart
66
order: 26-5
7-
cover: https://github.com/EchoChenGithub/images/blob/main/mall_map.png
7+
cover: https://cdn.jsdelivr.net/gh/EchoChenGithub/images/mall_map.gif
88
option: pictogramChart
99
---
1010

@@ -23,7 +23,7 @@ Shopping Mall Tenant Layout pictogram displays the distribution of different bus
2323

2424
```javascript livedemo
2525
// Use the fetch API to get SVG graphic data
26-
const response = await fetch('https://raw.githubusercontent.com/EchoChenGithub/images/refs/heads/main/mallmap_withoutcolor.svg');
26+
const response = await fetch('https://cdn.jsdelivr.net/gh/EchoChenGithub/images/mallmap_withoutcolor.svg');
2727
// Parse the response text content into an SVG graphic
2828
const shape = await response.text();
2929

docs/assets/examples/zh/pictogram-chart/pictogram-mall.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
category: examples
33
group: pictogram chart
44
title: 商场业态示意图
5-
keywords: pictogramChart
5+
keywords: pictogramChart, interaction
66
order: 26-5
7-
cover: https://github.com/EchoChenGithub/images/blob/main/mall_map.png
7+
cover: https://cdn.jsdelivr.net/gh/EchoChenGithub/images/mall_map.gif
88
option: pictogramChart
99
---
1010

@@ -21,19 +21,21 @@ option: pictogramChart
2121
- 交互:关闭 `legend``select` 配置,通过事件监听鼠标悬停图例事件,再通过状态更新 API `updateState` 来实现hover图例项高亮。需要在属性 `pictogram`中设定更新用的`state`
2222
- 数据:声明数据,数据格式为 `[{name: 'xxx', category: 'xxx'}]`
2323

24-
## Code Demo
24+
## 代码演示
2525

2626
```javascript livedemo
27-
/** --Add the following code when using in business context-- */
28-
// When using in business context, please additionally import
27+
/** --在业务中使用时请添加以下代码-- */
28+
// 在业务中使用时, 请额外引入 registerPictogramChart 并执行
2929
// import { registerPictogramChart } from '@visactor/vchart';
3030
// registerPictogramChart();
31-
/** --Add the above code when using in business context-- */
31+
/** --在业务中使用时请添加以上代码-- */
32+
33+
/** --在业务中使用时请删除以下代码-- */
3234
VCHART_MODULE.registerPictogramChart();
33-
/** --Delete the above code when using in business context-- */
35+
/** --在业务中使用时请删除以上代码-- */
3436

3537
// 使用 fetch API 获取 SVG 图形数据
36-
const response = await fetch('https://raw.githubusercontent.com/EchoChenGithub/images/refs/heads/main/mallmap_withoutcolor.svg');
38+
const response = await fetch('https://cdn.jsdelivr.net/gh/EchoChenGithub/images/mallmap_withoutcolor.svg');
3739
// 将响应的文本内容解析为 SVG 图形
3840
const shape = await response.text();
3941

@@ -238,6 +240,9 @@ vchart.on('legendItemUnHover', e => {
238240
// 渲染图表
239241
vchart.renderSync();
240242

243+
// Just for the convenience of console debugging, DO NOT COPY!
244+
window['vchart'] = vchart;
245+
241246
```
242247
243248
## 相关教程

0 commit comments

Comments
 (0)