2020-08-10 10:44:28 +08:00
|
|
|
---
|
|
|
|
title: 散点图
|
|
|
|
order: 2
|
|
|
|
---
|
2021-12-29 17:08:46 +08:00
|
|
|
|
2020-11-21 03:51:18 +08:00
|
|
|
`markdown:docs/common/style.md`
|
2020-08-20 17:09:45 +08:00
|
|
|
|
2020-08-10 10:44:28 +08:00
|
|
|
在地理区域上放置相等大小的圆点,用来表示地域上的空间布局或数据分布。
|
|
|
|
|
|
|
|
## 使用
|
2020-08-20 17:09:45 +08:00
|
|
|
|
|
|
|
散点图通过 PointLayer 对象实例化
|
2020-08-10 10:44:28 +08:00
|
|
|
|
|
|
|
### shape
|
|
|
|
|
|
|
|
- circle
|
|
|
|
- square
|
|
|
|
- hexagon
|
|
|
|
- triangle
|
|
|
|
- pentagon
|
|
|
|
- octogon
|
|
|
|
- hexagram
|
|
|
|
- rhombus
|
|
|
|
- vesica
|
|
|
|
|
2020-08-20 17:09:45 +08:00
|
|
|
散点图 shape 一般设置成常量
|
2020-08-10 10:44:28 +08:00
|
|
|
|
|
|
|
### color
|
|
|
|
|
|
|
|
color 可以根据数据的差异设置成不同颜色,表示数据的不同分类。
|
|
|
|
|
|
|
|
### size
|
2020-08-20 17:09:45 +08:00
|
|
|
|
2020-08-10 10:44:28 +08:00
|
|
|
散点图一般等大小的图形,size 一般设置成常量
|
|
|
|
|
|
|
|
```javascript
|
2020-08-20 17:09:45 +08:00
|
|
|
const scatter = new PointLayer()
|
|
|
|
.source(data)
|
|
|
|
.shape(circle)
|
|
|
|
.size(5)
|
|
|
|
.color('red')
|
|
|
|
.style({
|
|
|
|
opacity: 0.3,
|
|
|
|
strokeWidth: 1,
|
|
|
|
});
|
2020-08-10 10:44:28 +08:00
|
|
|
```
|
2021-12-29 17:08:46 +08:00
|
|
|
|
2020-11-16 15:19:41 +08:00
|
|
|
`markdown:docs/common/layer/base.md`
|