2
2
category : examples
3
3
group : pictogram chart
4
4
title : 商场业态示意图
5
- keywords : pictogramChart
5
+ keywords : pictogramChart, interaction
6
6
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
8
8
option : pictogramChart
9
9
---
10
10
@@ -21,19 +21,21 @@ option: pictogramChart
21
21
- 交互:关闭 ` legend ` 的 ` select ` 配置,通过事件监听鼠标悬停图例事件,再通过状态更新 API ` updateState ` 来实现hover图例项高亮。需要在属性 ` pictogram ` 中设定更新用的` state ` 。
22
22
- 数据:声明数据,数据格式为 ` [{name: 'xxx', category: 'xxx'}] ` ;
23
23
24
- ## Code Demo
24
+ ## 代码演示
25
25
26
26
``` javascript livedemo
27
- /** --Add the following code when using in business context -- */
28
- // When using in business context, please additionally import
27
+ /** --在业务中使用时请添加以下代码 -- */
28
+ // 在业务中使用时, 请额外引入 registerPictogramChart 并执行
29
29
// import { registerPictogramChart } from '@visactor/vchart';
30
30
// registerPictogramChart();
31
- /** --Add the above code when using in business context-- */
31
+ /** --在业务中使用时请添加以上代码-- */
32
+
33
+ /** --在业务中使用时请删除以下代码-- */
32
34
VCHART_MODULE .registerPictogramChart ();
33
- /** --Delete the above code when using in business context -- */
35
+ /** --在业务中使用时请删除以上代码 -- */
34
36
35
37
// 使用 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' );
37
39
// 将响应的文本内容解析为 SVG 图形
38
40
const shape = await response .text ();
39
41
@@ -238,6 +240,9 @@ vchart.on('legendItemUnHover', e => {
238
240
// 渲染图表
239
241
vchart .renderSync ();
240
242
243
+ // Just for the convenience of console debugging, DO NOT COPY!
244
+ window [' vchart' ] = vchart;
245
+
241
246
` ` `
242
247
243
248
## 相关教程
0 commit comments