Skip to content

Commit ab2c657

Browse files
committed
fix(chart): 特殊处理 TwoStateArea 渐变
1 parent 4e2c48b commit ab2c657

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

packages/chart/src/TwoStateArea/TwoStateArea.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { TwoStateAreaProps } from './types';
2+
import { darkColors } from '@sensoro-design/chart-theme';
23
import { AreaChart } from '@visactor/react-vchart';
34
import { merge } from '@visactor/vutils';
45
import React, { useMemo } from 'react';
@@ -14,7 +15,7 @@ export function TwoStateArea(props: TwoStateAreaProps) {
1415
xAxes,
1516
yAxes,
1617
// eslint-disable-next-line react/no-unstable-default-props
17-
color = ['#5C8BE6', '#3EB390'],
18+
color = [darkColors.blue2, '#3EB390'],
1819
tooltip,
1920
legend,
2021
...rest
@@ -59,6 +60,23 @@ export function TwoStateArea(props: TwoStateAreaProps) {
5960
area={{
6061
style: {
6162
curveType: 'step',
63+
fill: {
64+
gradient: 'linear',
65+
x0: 0.5,
66+
y0: 0,
67+
x1: 0.5,
68+
y1: 1,
69+
stops: [
70+
{
71+
offset: 0,
72+
opacity: 0.25,
73+
},
74+
{
75+
offset: 1,
76+
opacity: 0,
77+
},
78+
],
79+
},
6280
},
6381
}}
6482
line={lineData}

0 commit comments

Comments
 (0)