antvis/G2
The issue has been closed
[v5] point mark encode shape not as expected #4518
visiky posted onGitHub
现状
- 设置
encode('shape', 'diamond')
不生效,设置为point
时,可以生效
<img width="400" alt="image" src="https://user-images.githubusercontent.com/15646325/209428625-def52a1d-6d48-4139-af1d-ecb8f3aa38fe.png">
<img width="400" alt="image" src="https://user-images.githubusercontent.com/15646325/209428640-6dee3008-dcfd-4058-8ac4-54b27f60b93f.png">
代码
import { Chart } from '@antv/g2';
const chart = new Chart({
container: 'container',
height: 120,
});
chart
.point()
.data({
type: 'fetch',
value:
'https://gw.alipayobjects.com/os/basement_prod/6b4aa721-b039-49b9-99d8-540b3f87d339.json',
})
.encode('x', 'height')
// work
// .encode('shape','point')
// do not work
.encode('shape', 'diamond')
chart.render();