Skip to content

Commit cf4927a

Browse files
lxfu1liufu.lf
and
liufu.lf
authored
fix: 优化散点图 demos (#1608)
Co-authored-by: liufu.lf <[email protected]>
1 parent c26ec95 commit cf4927a

File tree

7 files changed

+61
-45
lines changed

7 files changed

+61
-45
lines changed

examples/scatter/basic/demo/basic.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ fetch('https://gw.alipayobjects.com/os/antfincdn/aao6XnO5pW/IMDB.json')
1010
yField: 'Rating',
1111
shape: 'circle',
1212
yAxis: {
13-
grid: {},
13+
line: {
14+
style: {
15+
stroke: '#aaa',
16+
},
17+
},
1418
},
1519
xAxis: {
1620
min: -100,
@@ -22,6 +26,11 @@ fetch('https://gw.alipayobjects.com/os/antfincdn/aao6XnO5pW/IMDB.json')
2226
},
2327
},
2428
},
29+
line: {
30+
style: {
31+
stroke: '#aaa',
32+
},
33+
},
2534
},
2635
pointStyle: {
2736
stroke: '#fff',

examples/scatter/basic/demo/color-mapping.ts

+12-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@ fetch('https://gw.alipayobjects.com/os/antfincdn/aao6XnO5pW/IMDB.json')
1010
yField: 'Rating',
1111
shape: 'circle',
1212
colorField: 'Genre',
13-
sizeField: 'Rating',
14-
size: [2, 5],
13+
color: ['#d62728', '#2ca02c', '#000000', '#9467bd', '#ffd500', '#1f77b4', '#00518a', '#ffbc69', '#9bd646'],
14+
size: 4,
1515
yAxis: {
1616
nice: true,
17+
line: {
18+
style: {
19+
stroke: '#aaa',
20+
},
21+
},
1722
},
1823
xAxis: {
1924
min: -100,
@@ -24,6 +29,11 @@ fetch('https://gw.alipayobjects.com/os/antfincdn/aao6XnO5pW/IMDB.json')
2429
},
2530
},
2631
},
32+
line: {
33+
style: {
34+
stroke: '#aaa',
35+
},
36+
},
2737
},
2838
pointStyle: {
2939
stroke: '#fff',

examples/scatter/basic/demo/label.ts

+13
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/3e4db10a-9da1-4b44-80d8-c128f427
1515
pointStyle: {
1616
fillOpacity: 1,
1717
},
18+
yAxis: {
19+
nice: true,
20+
line: {
21+
style: {
22+
stroke: '#aaa',
23+
},
24+
},
25+
},
1826
xAxis: {
1927
grid: {
2028
line: {
@@ -23,6 +31,11 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/3e4db10a-9da1-4b44-80d8-c128f427
2331
},
2432
},
2533
},
34+
line: {
35+
style: {
36+
stroke: '#aaa',
37+
},
38+
},
2639
},
2740
label: {},
2841
});

examples/scatter/basic/demo/meta.json

-8
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@
1818
"zh": "散点图颜色映射",
1919
"en": "the color mapping of Scatter chart"
2020
},
21-
"screenshot": "https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*Mds9Q7-zeHMAAAAAAAAAAABkARQnAQ"
22-
},
23-
{
24-
"filename": "shape-mapping.ts",
25-
"title": {
26-
"zh": "散点形状色映射",
27-
"en": "the shape mapping of Scatter chart"
28-
},
2921
"screenshot": "https://gw.alipayobjects.com/zos/antfincdn/kRFIJ2OlFs/FE726B54-2352-47F5-AAF9-B17D281CE513.png"
3022
},
3123
{

examples/scatter/basic/demo/quadrant.ts

+13
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/0b37279d-1674-42b4-b285-29683747
1515
shape: 'circle',
1616
pointStyle: {
1717
fillOpacity: 0.8,
18+
stroke: '#bbb',
1819
},
1920
xAxis: {
2021
min: -25,
@@ -26,6 +27,18 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/0b37279d-1674-42b4-b285-29683747
2627
},
2728
},
2829
},
30+
line: {
31+
style: {
32+
stroke: '#aaa',
33+
},
34+
},
35+
},
36+
yAxis: {
37+
line: {
38+
style: {
39+
stroke: '#aaa',
40+
},
41+
},
2942
},
3043
quadrant: {
3144
xBaseline: 0,

examples/scatter/basic/demo/shape-mapping.ts

-34
This file was deleted.

examples/scatter/basic/demo/size.ts

+13
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/0b37279d-1674-42b4-b285-29683747
1515
shape: 'circle',
1616
pointStyle: {
1717
fillOpacity: 0.8,
18+
stroke: '#bbb',
1819
},
1920
xAxis: {
2021
min: -25,
@@ -26,6 +27,18 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/0b37279d-1674-42b4-b285-29683747
2627
},
2728
},
2829
},
30+
line: {
31+
style: {
32+
stroke: '#aaa',
33+
},
34+
},
35+
},
36+
yAxis: {
37+
line: {
38+
style: {
39+
stroke: '#aaa',
40+
},
41+
},
2942
},
3043
});
3144
scatterPlot.render();

0 commit comments

Comments
 (0)