@@ -14,6 +14,7 @@ import Big from "big.js";
14
14
import { googleMapsApiUrl } from "../chartComp/chartConfigs/chartUrls" ;
15
15
import opacityToHex from "../../util/opacityToHex" ;
16
16
import parseBackground from "../../util/gradientBackgroundColor" ;
17
+ import { chartStyleWrapper , styleWrapper } from "../../util/styleWrapper" ;
17
18
18
19
export function transformData (
19
20
originData : JSONObject [ ] ,
@@ -143,15 +144,7 @@ export function getEchartsConfig(
143
144
"top" : props . echartsTitleVerticalConfig . top ,
144
145
"left" :props . echartsTitleConfig . top ,
145
146
"textStyle" : {
146
- "fontFamily" : props ?. titleStyle ?. chartFontFamily || theme ?. titleStyle ?. fontFamily ,
147
- "fontSize" : props ?. titleStyle ?. chartTextSize || theme ?. titleStyle ?. fontSize || '18' ,
148
- "fontWeight" : props ?. titleStyle ?. chartTextWeight || theme ?. titleStyle ?. fontWeight ,
149
- "color" : props ?. titleStyle ?. chartTextColor || theme ?. titleStyle ?. fontColor || "#000000" ,
150
- "fontStyle" : props ?. titleStyle ?. chartFontStyle || theme ?. titleStyle ?. fontStyle ,
151
- "textShadowColor" : props ?. titleStyle ?. chartShadowColor || theme ?. titleStyle ?. shadowColor ,
152
- "textShadowBlur" : props ?. titleStyle ?. chartBoxShadow ?. split ( 'px' ) [ 0 ] || theme ?. titleStyle ?. boxShadow ?. split ( 'px' ) [ 0 ] ,
153
- "textShadowOffsetX" : props ?. titleStyle ?. chartBoxShadow ?. split ( 'px' ) [ 1 ] || theme ?. titleStyle ?. boxShadow ?. split ( 'px' ) [ 1 ] ,
154
- "textShadowOffsetY" : props ?. titleStyle ?. chartBoxShadow ?. split ( 'px' ) [ 2 ] || theme ?. titleStyle ?. boxShadow ?. split ( 'px' ) [ 2 ]
147
+ ...styleWrapper ( props ?. titleStyle , theme ?. titleStyle )
155
148
}
156
149
} ,
157
150
"backgroundColor" : parseBackground ( props ?. chartStyle ?. background || theme ?. chartStyle ?. backgroundColor || "#FFFFFF" ) ,
@@ -166,15 +159,7 @@ export function getEchartsConfig(
166
159
"left" : props . echartsLegendAlignConfig . left ,
167
160
"orient" : props . echartsLegendOrientConfig . orient ,
168
161
"textStyle" : {
169
- "fontFamily" : props ?. legendStyle ?. chartFontFamily || theme ?. legendStyle ?. fontFamily ,
170
- "fontSize" : props ?. legendStyle ?. chartTextSize || theme ?. legendStyle ?. fontSize ,
171
- "fontWeight" : props ?. legendStyle ?. chartTextWeight || theme ?. legendStyle ?. fontWeight ,
172
- "color" : props ?. legendStyle ?. chartTextColor || theme ?. legendStyle ?. fontColor || "#000000" ,
173
- "fontStyle" : props ?. legendStyle ?. chartFontStyle || theme ?. legendStyle ?. fontStyle ,
174
- "textShadowColor" : props ?. legendStyle ?. chartShadowColor || theme ?. legendStyle ?. shadowColor ,
175
- "textShadowBlur" : props ?. legendStyle ?. chartBoxShadow ?. split ( 'px' ) [ 0 ] || theme ?. legendStyle ?. boxShadow ?. split ( 'px' ) [ 0 ] ,
176
- "textShadowOffsetX" : props ?. legendStyle ?. chartBoxShadow ?. split ( 'px' ) [ 1 ] || theme ?. legendStyle ?. boxShadow ?. split ( 'px' ) [ 1 ] ,
177
- "textShadowOffsetY" : props ?. legendStyle ?. chartBoxShadow ?. split ( 'px' ) [ 2 ] || theme ?. legendStyle ?. boxShadow ?. split ( 'px' ) [ 2 ]
162
+ ...styleWrapper ( props ?. legendStyle , theme ?. legendStyle )
178
163
}
179
164
} ,
180
165
"series" : [
@@ -192,27 +177,12 @@ export function getEchartsConfig(
192
177
"sort" : props . echartsSortingConfig . sort ,
193
178
"itemStyle" : {
194
179
"opacity" : props . opacity ,
195
- "borderColor" : props ?. chartStyle ?. chartBorderColor || theme ?. chartStyle ?. borderColor ,
196
- "borderWidth" : props ?. chartStyle ?. chartBorderWidth || theme ?. chartStyle ?. borderWidth ,
197
- "borderType" : props ?. chartStyle ?. chartBorderStyle || theme ?. chartStyle ?. borderType ,
198
- "borderRadius" : Number ( props ?. chartStyle ?. chartBorderRadius || theme ?. chartStyle ?. borderRadius ) ,
199
- "shadowColor" : props ?. chartStyle ?. chartShadowColor || theme ?. chartStyle ?. shadowColor ,
200
- "shadowBlur" : props ?. chartStyle ?. chartBoxShadow ?. split ( 'px' ) [ 0 ] || theme ?. chartStyle ?. boxShadow ?. split ( 'px' ) [ 0 ] ,
201
- "shadowOffsetX" : props ?. chartStyle ?. chartBoxShadow ?. split ( 'px' ) [ 1 ] || theme ?. chartStyle ?. boxShadow ?. split ( 'px' ) [ 1 ] ,
202
- "shadowOffsetY" : props ?. chartStyle ?. chartBoxShadow ?. split ( 'px' ) [ 2 ] || theme ?. chartStyle ?. boxShadow ?. split ( 'px' ) [ 2 ]
180
+ ...chartStyleWrapper ( props ?. chartStyle , theme ?. chartStyle ) ,
203
181
} ,
204
182
"label" : {
205
183
"show" : props . label ,
206
184
"position" : props . echartsLabelConfig . top ,
207
- "fontFamily" : props ?. labelStyle ?. chartFontFamily || theme ?. labelStyle ?. fontFamily ,
208
- "fontSize" : props ?. labelStyle ?. chartTextSize || theme ?. labelStyle ?. fontSize ,
209
- "fontWeight" : props ?. labelStyle ?. chartTextWeight || theme ?. labelStyle ?. fontWeight ,
210
- "color" : props ?. labelStyle ?. chartTextColor || theme ?. labelStyle ?. fontColor || "#000000" ,
211
- "fontStyle" : props ?. labelStyle ?. chartFontStyle || theme ?. labelStyle ?. fontStyle ,
212
- "textShadowColor" : props ?. labelStyle ?. chartShadowColor || theme ?. labelStyle ?. shadowColor ,
213
- "textShadowBlur" : props ?. labelStyle ?. chartBoxShadow ?. split ( 'px' ) [ 0 ] || theme ?. labelStyle ?. boxShadow ?. split ( 'px' ) [ 0 ] ,
214
- "textShadowOffsetX" : props ?. labelStyle ?. chartBoxShadow ?. split ( 'px' ) [ 1 ] || theme ?. labelStyle ?. boxShadow ?. split ( 'px' ) [ 1 ] ,
215
- "textShadowOffsetY" : props ?. labelStyle ?. chartBoxShadow ?. split ( 'px' ) [ 2 ] || theme ?. labelStyle ?. boxShadow ?. split ( 'px' ) [ 2 ]
185
+ ...styleWrapper ( props ?. labelStyle , theme ?. labelStyle ) ,
216
186
} ,
217
187
"data" : props . echartsOption . data
218
188
}
0 commit comments