Skip to content

Commit

Permalink
docs: joinBy
Browse files Browse the repository at this point in the history
  • Loading branch information
lvisei committed Jan 18, 2022
1 parent eb2aeba commit 03525c3
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions website/docs/api/plots/choropleth.zh.md
Expand Up @@ -64,13 +64,17 @@ const choropleth = new Choropleth(container, options);
| 属性 | 描述 | 类型 | 默认值 | 是否必填 |
| ----------- | ------------------------------------------ | ------------------- | ---------- | -------- |
| sourceField | 业务元数据地理字段 | `string` | | required |
| geoField | 地理数据字段 | `string` | `'adcode'` | optional |
| geoField | 地理数据字段 | `'adcode'|'name'` | `'adcode'` | optional |
| geoData | 地理数据,设置则覆盖当前层级的行政地址数据 | `FeatureCollection` | | optional |

业务数据与地理数据关联主要有以下两种方式。行政名称与编码映射关系详见[行政名称表格](https://www.yuque.com/antv/qbux5m/wrxc8h#yyIb)[行政名称数据](https://gw.alipayobjects.com/os/alisis/geo-data-v0.1.1/administrative-data/area-list.json)

1. 根据行政编码匹配渲染

```js
{
source: {
data: [{ name: '上海市', code: 310000, value: 200 }],
data: [{ cityName: '上海市', code: 310000, value: 200 }],
joinBy: {
sourceField: 'code',
geoField: 'adcode',
Expand All @@ -79,6 +83,20 @@ const choropleth = new Choropleth(container, options);
}
```

2. 根据行政名称匹配渲染

```js
{
source: {
data: [{ cityName: '上海市', code: 310000, value: 200 }],
joinBy: {
sourceField: 'cityName',
geoField: 'name',
},
},
}
```

### `options.`viewLevel

`ViewLevel` required
Expand Down

0 comments on commit 03525c3

Please sign in to comment.