Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: 修复缩略图 demo 不一致, 删除重复 demo #1661

Merged
merged 1 commit into from
Sep 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/area/basic/demo/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@
"zh": "基础面积图",
"en": "basic Area chart"
},
"screenshot": "https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*aARCQbtAl4AAAAAAAAAAAABkARQnAQ"
"screenshot": "https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*AE2CTr-Uz3QAAAAAAAAAAAAAARQnAQ"
},
{
"filename": "basic-gradients.ts",
"title": {
"zh": "渐变色面积图",
"en": "gradients Area chart"
},
"screenshot": "https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*aARCQbtAl4AAAAAAAAAAAABkARQnAQ"
"screenshot": "https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*4dnrSbNeOGQAAAAAAAAAAAAAARQnAQ"
},
{
"filename": "basic-slider.ts",
"title": {
"zh": "缩略轴面积图",
"en": "slider Area chart"
},
"screenshot": "https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*aARCQbtAl4AAAAAAAAAAAABkARQnAQ"
"screenshot": "https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*xXtxRLa2CHoAAAAAAAAAAAAAARQnAQ"
},
{
"filename": "basic-annotation.ts",
"title": {
"zh": "带中位线标注的基础面积图",
"en": "basic Area chart with Line Annotation"
},
"screenshot": "https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*aARCQbtAl4AAAAAAAAAAAABkARQnAQ"
"screenshot": "https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*7dkjRqqCukoAAAAAAAAAAAAAARQnAQ"
}
]
}
3 changes: 3 additions & 0 deletions examples/area/stacked/demo/area-large-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/55424a73-7cb8-4f79-b60d-3ab627ac
formatter: (v) => `${v}`.replace(/\d{1,3}(?=(\d{3})+$)/g, (s) => `${s},`),
},
},
legend: {
position: 'top',
},
});

area.render();
Expand Down
3 changes: 3 additions & 0 deletions examples/area/stacked/demo/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/b21e7336-0b3e-486c-9070-612ede49
xField: 'date',
yField: 'value',
seriesField: 'country',
legend: {
position: 'right-top',
},
});
area.render();
});
2 changes: 1 addition & 1 deletion examples/area/stacked/demo/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"zh": "带缩略轴堆叠面积图",
"en": "StackedArea with slider"
},
"screenshot": "https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*u6u1RqMG9coAAAAAAAAAAABkARQnAQ"
"screenshot": "https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*LGuMQ4uO_0EAAAAAAAAAAAAAARQnAQ"
}
]
}
2 changes: 1 addition & 1 deletion examples/bar/basic/demo/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"zh": "基础条形图 - 自定义颜色",
"en": "Bar chart color"
},
"screenshot": "https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*uSKqQo2lCPoAAAAAAAAAAABkARQnAQ"
"screenshot": "https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*IfUNT5Mhz_IAAAAAAAAAAAAAARQnAQ"
},
{
"filename": "width.ts",
Expand Down
115 changes: 44 additions & 71 deletions examples/bar/grouped/demo/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,103 +2,76 @@ import { Bar } from '@antv/g2plot';

const data = [
{
year: '1991',
value: 3,
type: 'Lon',
label: 'Mon.',
type: 'series1',
value: 2800,
},
{
year: '1992',
value: 4,
type: 'Lon',
label: 'Mon.',
type: 'series2',
value: 2260,
},
{
year: '1993',
value: 3.5,
type: 'Lon',
label: 'Tues.',
type: 'series1',
value: 1800,
},
{
year: '1994',
value: 5,
type: 'Lon',
label: 'Tues.',
type: 'series2',
value: 1300,
},
{
year: '1995',
value: 4.9,
type: 'Lon',
label: 'Wed.',
type: 'series1',
value: 950,
},
{
year: '1996',
value: 6,
type: 'Lon',
label: 'Wed.',
type: 'series2',
value: 900,
},
{
year: '1997',
value: 7,
type: 'Lon',
label: 'Thur.',
type: 'series1',
value: 500,
},
{
year: '1998',
value: 9,
type: 'Lon',
label: 'Thur.',
type: 'series2',
value: 390,
},
{
year: '1999',
value: 13,
type: 'Lon',
label: 'Fri.',
type: 'series1',
value: 170,
},
{
year: '1991',
value: 3,
type: 'Bor',
},
{
year: '1992',
value: 4,
type: 'Bor',
},
{
year: '1993',
value: 3.5,
type: 'Bor',
},
{
year: '1994',
value: 5,
type: 'Bor',
},
{
year: '1995',
value: 4.9,
type: 'Bor',
},
{
year: '1996',
value: 6,
type: 'Bor',
},
{
year: '1997',
value: 7,
type: 'Bor',
},
{
year: '1998',
value: 9,
type: 'Bor',
},
{
year: '1999',
value: 13,
type: 'Bor',
label: 'Fri.',
type: 'series2',
value: 100,
},
];

const stackedBarPlot = new Bar('container', {
data,
isGroup: true,
xField: 'value',
yField: 'year',
yField: 'label',
color: ['#1383ab', '#c52125'],
seriesField: 'type',
marginRatio: 0,
label: {
// 可手动配置 label 数据标签位置
position: 'middle', // 'left', 'middle', 'right'
// 可配置附加的布局方法
layout: [
// 柱形图数据标签位置自动调整
{ type: 'interval-adjust-position' },
// 数据标签文颜色自动调整
{ type: 'adjust-color' },
],
},
});

stackedBarPlot.render();
115 changes: 0 additions & 115 deletions examples/bar/grouped/demo/label.ts

This file was deleted.

Loading