@@ -135,38 +135,62 @@ export function getEchartsConfig(
135
135
chartSize ?: ChartSize ,
136
136
theme ?: any ,
137
137
) : EChartsOptionWithMap {
138
+
139
+
138
140
if ( props . mode === "json" ) {
139
141
let opt = {
140
142
"title" : {
141
143
"text" : props . echartsTitle ,
142
144
'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
+ }
144
157
} ,
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 && {
148
161
"trigger" : "axis" ,
149
162
"axisPointer" : {
150
163
"type" : "cross"
151
164
}
152
165
} ,
153
166
"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 } %` ,
157
171
} ,
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
+ ] ,
158
182
"xAxis" : {
159
183
"type" : "category" ,
160
- "data" : props . echartsOption . xAxis . data
184
+ "data" : props ? .echartsOption . xAxis . data
161
185
} ,
162
186
"yAxis" : {
163
187
"type" : "value" ,
164
188
"scale" : true
165
189
} ,
166
190
"series" : [
167
191
{
168
- "name" : props . echartsConfig . type ,
169
- "type" : props . echartsConfig . type ,
192
+ "name" : props ? .echartsConfig . type ,
193
+ "type" : props ? .echartsConfig . type ,
170
194
"left" : "10%" ,
171
195
"top" : 60 ,
172
196
"bottom" : 60 ,
@@ -176,9 +200,9 @@ export function getEchartsConfig(
176
200
"gap" : 2 ,
177
201
"label" : {
178
202
"show" : true ,
179
- "position" : props . echartsLabelConfig . top
203
+ "position" : props ? .echartsLabelConfig . top
180
204
} ,
181
- "data" : props . echartsOption . data ,
205
+ "data" : props ? .echartsOption . data ,
182
206
}
183
207
]
184
208
}
0 commit comments