@@ -14,6 +14,7 @@ import Big from "big.js";
1414import { googleMapsApiUrl } from "../chartComp/chartConfigs/chartUrls" ;
1515import opacityToHex from "../../util/opacityToHex" ;
1616import parseBackground from "../../util/gradientBackgroundColor" ;
17+ import { chartStyleWrapper , styleWrapper } from "../../util/styleWrapper" ;
1718
1819export function transformData (
1920 originData : JSONObject [ ] ,
@@ -143,15 +144,7 @@ export function getEchartsConfig(
143144 "top" : props . echartsTitleVerticalConfig . top ,
144145 "left" :props . echartsTitleConfig . top ,
145146 "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 )
155148 }
156149 } ,
157150 "backgroundColor" : parseBackground ( props ?. chartStyle ?. background || theme ?. chartStyle ?. backgroundColor || "#FFFFFF" ) ,
@@ -166,15 +159,7 @@ export function getEchartsConfig(
166159 "left" : props . echartsLegendAlignConfig . left ,
167160 "orient" : props . echartsLegendOrientConfig . orient ,
168161 "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 )
178163 }
179164 } ,
180165 "series" : [
@@ -192,27 +177,12 @@ export function getEchartsConfig(
192177 "sort" : props . echartsSortingConfig . sort ,
193178 "itemStyle" : {
194179 "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 ) ,
203181 } ,
204182 "label" : {
205183 "show" : props . label ,
206184 "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 ) ,
216186 } ,
217187 "data" : props . echartsOption . data
218188 }
0 commit comments