@@ -135,38 +135,62 @@ export function getEchartsConfig(
135135 chartSize ?: ChartSize ,
136136 theme ?: any ,
137137) : EChartsOptionWithMap {
138+
139+
138140 if ( props . mode === "json" ) {
139141 let opt = {
140142 "title" : {
141143 "text" : props . echartsTitle ,
142144 'top' : props . echartsLegendConfig . top === 'bottom' ?'top' :'bottom' ,
143- "left" :"center"
145+ "left" :props . echartsTitleConfig . top ,
146+ "textStyle" : {
147+ "fontFamily" : props ?. titleStyle ?. chartFontFamily || theme ?. titleStyle ?. fontFamily ,
148+ "fontSize" : props ?. titleStyle ?. chartTextSize || theme ?. titleStyle ?. fontSize || '18' ,
149+ "fontWeight" : props ?. titleStyle ?. chartTextWeight || theme ?. titleStyle ?. fontWeight ,
150+ "color" : props ?. titleStyle ?. chartTextColor || theme ?. titleStyle ?. fontColor || "#000000" ,
151+ "fontStyle" : props ?. titleStyle ?. chartFontStyle || theme ?. titleStyle ?. fontStyle ,
152+ "textShadowColor" : props ?. titleStyle ?. chartShadowColor || theme ?. titleStyle ?. shadowColor ,
153+ "textShadowBlur" : props ?. titleStyle ?. chartBoxShadow ?. split ( 'px' ) [ 0 ] || theme ?. titleStyle ?. boxShadow ?. split ( 'px' ) [ 0 ] ,
154+ "textShadowOffsetX" : props ?. titleStyle ?. chartBoxShadow ?. split ( 'px' ) [ 1 ] || theme ?. titleStyle ?. boxShadow ?. split ( 'px' ) [ 1 ] ,
155+ "textShadowOffsetY" : props ?. titleStyle ?. chartBoxShadow ?. split ( 'px' ) [ 2 ] || theme ?. titleStyle ?. boxShadow ?. split ( 'px' ) [ 2 ]
156+ }
144157 } ,
145- "backgroundColor" : parseBackground ( props ?. style ?. background || theme ?. style ?. background || "#FFFFFF" ) ,
146- "color" : props . echartsOption . data ?. map ( data => data . color ) ,
147- "tooltip" : props . tooltip && {
158+ "backgroundColor" : parseBackground ( props ?. chartStyle ?. background || theme ?. chartStyle ?. backgroundColor || "#FFFFFF" ) ,
159+ "color" : props ? .echartsOption . data ?. map ( data => data . color ) ,
160+ "tooltip" : props ? .tooltip && {
148161 "trigger" : "axis" ,
149162 "axisPointer" : {
150163 "type" : "cross"
151164 }
152165 } ,
153166 "grid" : {
154- "left" : "10%" ,
155- "right" : "10%" ,
156- "bottom" : "10%" ,
167+ "left" : `${ props ?. left } %` ,
168+ "right" : `${ props ?. right } %` ,
169+ "bottom" : `${ props ?. bottom } %` ,
170+ "top" : `${ props ?. top } %` ,
157171 } ,
172+ "dataZoom" : [
173+ {
174+ "show" : props ?. dataZoomVisibility ,
175+ "type" : 'slider' ,
176+ "start" : 0 ,
177+ "end" : 100 ,
178+ "bottom" : props ?. dataZoomBottom ,
179+ 'height' : props ?. dataZoomHeight
180+ }
181+ ] ,
158182 "xAxis" : {
159183 "type" : "category" ,
160- "data" : props . echartsOption . xAxis . data
184+ "data" : props ? .echartsOption . xAxis . data
161185 } ,
162186 "yAxis" : {
163187 "type" : "value" ,
164188 "scale" : true
165189 } ,
166190 "series" : [
167191 {
168- "name" : props . echartsConfig . type ,
169- "type" : props . echartsConfig . type ,
192+ "name" : props ? .echartsConfig . type ,
193+ "type" : props ? .echartsConfig . type ,
170194 "left" : "10%" ,
171195 "top" : 60 ,
172196 "bottom" : 60 ,
@@ -176,9 +200,9 @@ export function getEchartsConfig(
176200 "gap" : 2 ,
177201 "label" : {
178202 "show" : true ,
179- "position" : props . echartsLabelConfig . top
203+ "position" : props ? .echartsLabelConfig . top
180204 } ,
181- "data" : props . echartsOption . data ,
205+ "data" : props ? .echartsOption . data ,
182206 }
183207 ]
184208 }
0 commit comments