@@ -134,6 +134,10 @@ export function getEchartsConfig(
134
134
chartSize ?: ChartSize ,
135
135
theme ?: any ,
136
136
) : EChartsOptionWithMap {
137
+ const backgroundColor = props ?. chartStyle ?. background || theme ?. chartStyle ?. backgroundColor ;
138
+ const gradientColor = props ?. chartStyle ?. gradientBackground || theme ?. chartStyle ?. gradientColor ;
139
+ const opacity = props ?. chartStyle ?. opacity || theme ?. chartStyle ?. opacity ;
140
+ const direction = props ?. chartStyle ?. direction || theme ?. chartStyle ?. direction ;
137
141
138
142
console . log ( "props" , props ) ;
139
143
console . log ( "theme" , theme ) ;
@@ -156,18 +160,18 @@ export function getEchartsConfig(
156
160
"textShadowOffsetY" : props ?. titleStyle ?. boxShadow ?. split ( 'px' ) [ 2 ] || theme ?. titleStyle ?. boxShadow . split ( 'px' ) [ 2 ]
157
161
}
158
162
} ,
159
- "backgroundColor" : props ?. chartStyle ?. background || theme ?. chartStyle ?. backgroundColor ,
160
- // ? {
161
- // "x": props?.chartStyle?. direction?.split(' ')[0],
162
- // "y": props?.chartStyle?. direction?.split(' ')[1],
163
- // "x2": props?.chartStyle?. direction?.split(' ')[2],
164
- // "y2": props?.chartStyle?. direction?.split(' ')[3],
165
- // "colorStops": [
166
- // { "offset": 0, "color": props?.chartStyle?. opacity ? props?.chartStyle?.background + opacityToHex(props?.chartStyle?. opacity) : props?.chartStyle?.background },
167
- // { "offset": 1, "color": props?.chartStyle?. opacity ? props?.chartStyle?.gradientBackground + opacityToHex(props?.chartStyle?. opacity) : props?.chartStyle?.gradientBackground }
168
- // ]
169
- // }
170
- // : props?.chartStyle?.opacity ? (props?.chartStyle?.background) + opacityToHex(props?.chartStyle?. opacity) : props?.chartStyle?.background ,
163
+ "backgroundColor" : gradientColor && backgroundColor
164
+ ? {
165
+ "x" : direction ?. split ( ' ' ) [ 0 ] ,
166
+ "y" : direction ?. split ( ' ' ) [ 1 ] ,
167
+ "x2" : direction ?. split ( ' ' ) [ 2 ] ,
168
+ "y2" : direction ?. split ( ' ' ) [ 3 ] ,
169
+ "colorStops" : [
170
+ { "offset" : 0 , "color" : opacity ? backgroundColor + opacityToHex ( opacity ) : backgroundColor || "#FFFFFF" } ,
171
+ { "offset" : 1 , "color" : opacity ? gradientColor + opacityToHex ( opacity ) : gradientColor || "#FFFFFF" }
172
+ ]
173
+ }
174
+ : backgroundColor + opacityToHex ( opacity ) ,
171
175
"color" : props . echartsOption . data ?. map ( data => data . color ) ,
172
176
"tooltip" : props . tooltip && {
173
177
"trigger" : "item" ,
0 commit comments