Skip to content

Commit c9bc70b

Browse files
authored
chore: update waterfall demo (#3114)
* chore: update waterfall demo * Update basic.js
1 parent a707073 commit c9bc70b

File tree

1 file changed

+23
-8
lines changed
  • site/examples/statistics/waterfall/demo

1 file changed

+23
-8
lines changed

site/examples/statistics/waterfall/demo/basic.js

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,38 @@ const DemoWaterfall = () => {
2525
return d.isTotal ? '#96a6a6' : d.value > 0 ? '#F56E53' : '#3CC27F';
2626
},
2727
},
28-
label: [
29-
{
30-
text: 'value',
31-
formatter: '~s',
32-
position: 'inside',
33-
fontSize: 10,
34-
},
28+
labels: [
3529
{
3630
text: (arg) => {
37-
return `${arg.y1 / 10000000} 亿`;
31+
return `${arg.__end__ / 1000000} 百万`;
3832
},
3933
position: (d) => (d.value > 0 ? 'top' : 'bottom'),
4034
textBaseline: (d) => (d.value > 0 ? 'bottom' : 'top'),
4135
fontSize: 10,
4236
dy: (d) => (d.value > 0 ? -4 : 4),
4337
},
38+
{
39+
text: (arg) => {
40+
return `${arg.value / 1000000} 百万`;
41+
},
42+
position: 'inside',
43+
fontSize: 10,
44+
},
4445
],
46+
tooltip: {
47+
items: [
48+
{
49+
name: 'start',
50+
channel: 'y',
51+
valueFormatter: '~s'
52+
},
53+
{
54+
name: 'end',
55+
channel: 'y1',
56+
valueFormatter: '~s'
57+
}
58+
]
59+
}
4560
};
4661
return <Waterfall {...config} />;
4762
};

0 commit comments

Comments
 (0)