@@ -13,6 +13,7 @@ import { calcXYConfig } from "comps/chartComp/chartConfigs/cartesianAxisConfig";
13
13
import Big from "big.js" ;
14
14
import { googleMapsApiUrl } from "../chartComp/chartConfigs/chartUrls" ;
15
15
import { useContext } from "react" ;
16
+ import parseBackground from "../../util/gradientBackgroundColor" ;
16
17
17
18
export function transformData (
18
19
originData : JSONObject [ ] ,
@@ -136,62 +137,62 @@ export function getEchartsConfig(
136
137
) : EChartsOptionWithMap {
137
138
if ( props . mode === "json" ) {
138
139
let opt = {
139
- "title" : {
140
- "text" : props . echartsTitle ,
141
- 'top' : props . echartsLegendConfig . top === 'bottom' ?'top' :'bottom' ,
142
- "left" :"center"
143
- } ,
144
- "backgroundColor" : props ?. style ?. background || theme ?. style ?. background ,
145
- "color" : props . echartsOption . data ?. map ( data => data . color ) ,
146
- "tooltip" : props . tooltip && {
147
- "trigger" : "axis" ,
148
- "axisPointer" : {
149
- "type" : "cross"
150
- }
151
- } ,
152
- "grid" : {
153
- "left" : "10%" ,
154
- "right" : "10%" ,
155
- "bottom" : "10%" ,
156
- } ,
157
- "xAxis" : {
158
- "type" : "category" ,
159
- "data" : props . echartsOption . xAxis . data
160
- } ,
161
- "yAxis" : {
162
- "type" : "value" ,
163
- "scale" : true
164
- } ,
165
- "series" : [
166
- {
167
- "name" : props . echartsConfig . type ,
168
- "type" : props . echartsConfig . type ,
169
- "left" : "10%" ,
170
- "top" : 60 ,
171
- "bottom" : 60 ,
172
- "width" : "80%" ,
173
- "min" : 0 ,
174
- "max" : 100 ,
175
- "gap" : 2 ,
176
- "label" : {
177
- "show" : true ,
178
- "position" : props . echartsLabelConfig . top
140
+ "title" : {
141
+ "text" : props . echartsTitle ,
142
+ 'top' : props . echartsLegendConfig . top === 'bottom' ?'top' :'bottom' ,
143
+ "left" :"center"
144
+ } ,
145
+ "backgroundColor" : parseBackground ( props ?. style ?. background || theme ?. style ?. background || "#FFFFFF" ) ,
146
+ "color" : props . echartsOption . data ?. map ( data => data . color ) ,
147
+ "tooltip" : props . tooltip && {
148
+ "trigger" : "axis" ,
149
+ "axisPointer" : {
150
+ "type" : "cross"
151
+ }
152
+ } ,
153
+ "grid" : {
154
+ "left" : "10%" ,
155
+ "right" : "10%" ,
156
+ "bottom" : "10%" ,
157
+ } ,
158
+ "xAxis" : {
159
+ "type" : "category" ,
160
+ "data" : props . echartsOption . xAxis . data
161
+ } ,
162
+ "yAxis" : {
163
+ "type" : "value" ,
164
+ "scale" : true
179
165
} ,
180
- "data" : props . echartsOption . data ,
166
+ "series" : [
167
+ {
168
+ "name" : props . echartsConfig . type ,
169
+ "type" : props . echartsConfig . type ,
170
+ "left" : "10%" ,
171
+ "top" : 60 ,
172
+ "bottom" : 60 ,
173
+ "width" : "80%" ,
174
+ "min" : 0 ,
175
+ "max" : 100 ,
176
+ "gap" : 2 ,
177
+ "label" : {
178
+ "show" : true ,
179
+ "position" : props . echartsLabelConfig . top
180
+ } ,
181
+ "data" : props . echartsOption . data ,
182
+ }
183
+ ]
181
184
}
182
- ]
183
- }
184
185
return props . echartsOption ? opt : { } ;
185
-
186
+
186
187
}
187
-
188
+
188
189
if ( props . mode === "map" ) {
189
190
const {
190
191
mapZoomLevel,
191
192
mapCenterLat,
192
193
mapCenterLng,
193
- mapOptions,
194
- showCharts,
194
+ mapOptions,
195
+ showCharts,
195
196
} = props ;
196
197
197
198
const echartsOption = mapOptions && showCharts ? mapOptions : { } ;
0 commit comments