Skip to content

Commit

Permalink
docs: add example line with zero values (#6312)
Browse files Browse the repository at this point in the history
  • Loading branch information
pearmini authored Jun 24, 2024
1 parent 1571ad4 commit ebd6ee6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
24 changes: 24 additions & 0 deletions site/examples/general/line/demo/line-zero-values.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Chart } from '@antv/g2';

const chart = new Chart({
container: 'container',
});

chart
.line()
.data([
{ date: '06-10', count: 0, type: '测试' },
{ date: '06-11', count: 0, type: '测试' },
{ date: '06-12', count: 0, type: '测试' },
{ date: '06-13', count: 0, type: '测试' },
{ date: '06-14', count: 0, type: '测试' },
{ date: '06-15', count: 0, type: '测试' },
{ date: '06-16', count: 0, type: '测试' },
])
.encode('x', 'date')
.encode('y', 'count')
.scale('y', {
domain: [0, 1],
});

chart.render();
8 changes: 8 additions & 0 deletions site/examples/general/line/demo/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
},
"screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*xvGZQY7sKhIAAAAAAAAAAAAADmJ7AQ/original"
},
{
"filename": "line-zero-values.ts",
"title": {
"zh": "零值折线图",
"en": "Line with Zero Values"
},
"screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*FXVWSISFZhcAAAAAAAAAAAAADmJ7AQ/original"
},
{
"filename": "line-basic.ts",
"title": {
Expand Down

0 comments on commit ebd6ee6

Please sign in to comment.