@@ -17,7 +17,9 @@ import {
17
17
clickEvent ,
18
18
styleControl ,
19
19
EchartDefaultChartStyle ,
20
- EchartDefaultTextStyle
20
+ EchartDefaultTextStyle ,
21
+ ColorControl ,
22
+ EchartDefaultDetailStyle
21
23
} from "lowcoder-sdk" ;
22
24
import { RecordConstructorToComp , RecordConstructorToView } from "lowcoder-core" ;
23
25
import { BarChartConfig } from "../chartComp/chartConfigs/barChartConfig" ;
@@ -34,25 +36,6 @@ import { i18nObjs, trans } from "i18n/comps";
34
36
import { GaugeChartConfig } from "../chartComp/chartConfigs/gaugeChartConfig" ;
35
37
import { EchartsTitleConfig } from "comps/chartComp/chartConfigs/echartsTitleConfig" ;
36
38
37
- export const ChartTypeOptions = [
38
- {
39
- label : trans ( "chart.bar" ) ,
40
- value : "bar" ,
41
- } ,
42
- {
43
- label : trans ( "chart.line" ) ,
44
- value : "line" ,
45
- } ,
46
- {
47
- label : trans ( "chart.scatter" ) ,
48
- value : "scatter" ,
49
- } ,
50
- {
51
- label : trans ( "chart.pie" ) ,
52
- value : "pie" ,
53
- } ,
54
- ] as const ;
55
-
56
39
export const UIEventOptions = [
57
40
{
58
41
label : trans ( "chart.select" ) ,
@@ -232,6 +215,41 @@ const EchartsOptionMap = {
232
215
gauge : GaugeChartConfig ,
233
216
} ;
234
217
218
+ const ChartTypeOptions = [
219
+ {
220
+ label : trans ( "chart.default" ) ,
221
+ value : "default" ,
222
+ } ,
223
+ {
224
+ label : trans ( "chart.stageGauge" ) ,
225
+ value : "stageGauge" ,
226
+ } ,
227
+ {
228
+ label : trans ( "chart.gradeGauge" ) ,
229
+ value : "gradeGauge" ,
230
+ } ,
231
+ {
232
+ label : trans ( "chart.temperatureGauge" ) ,
233
+ value : "temperatureGauge" ,
234
+ } ,
235
+ {
236
+ label : trans ( "chart.multiGauge" ) ,
237
+ value : "multiGauge" ,
238
+ } ,
239
+ {
240
+ label : trans ( "chart.ringGauge" ) ,
241
+ value : "ringGauge" ,
242
+ } ,
243
+ {
244
+ label : trans ( "chart.barometerGauge" ) ,
245
+ value : "barometerGauge" ,
246
+ } ,
247
+ {
248
+ label : trans ( "chart.clockGauge" ) ,
249
+ value : "clockGauge" ,
250
+ } ,
251
+ ] as const ;
252
+
235
253
const ChartOptionComp = withType ( ChartOptionMap , "bar" ) ;
236
254
const EchartsOptionComp = withType ( EchartsOptionMap , "gauge" ) ;
237
255
export type CharOptionCompType = keyof typeof ChartOptionMap ;
@@ -251,6 +269,15 @@ export const chartUiModeChildren = {
251
269
252
270
let chartJsonModeChildren : any = {
253
271
echartsOption : jsonControl ( toObject , i18nObjs . defaultGaugeChartOption ) ,
272
+ stageGaugeOption : jsonControl ( toObject , i18nObjs . defaultStageGaugeChartOption ) ,
273
+ gradeGaugeOption : jsonControl ( toObject , i18nObjs . defaultGradeGaugeChartOption ) ,
274
+ temperatureGaugeOption : jsonControl ( toObject , i18nObjs . defaultTemperatureGaugeChartOption ) ,
275
+ multiTitleGaugeOption : jsonControl ( toObject , i18nObjs . defaultMultiTitleGaugeChartOption ) ,
276
+ ringGaugeOption : jsonControl ( toObject , i18nObjs . defaultRingGaugeChartOption ) ,
277
+ clockGaugeOption : jsonControl ( toObject , i18nObjs . defaultClockGaugeChartOption ) ,
278
+ barometerGaugeOption : jsonControl ( toObject , i18nObjs . defaultBarometerGaugeChartOption ) ,
279
+
280
+ chartType : dropdownControl ( ChartTypeOptions , trans ( "chart.default" ) ) ,
254
281
echartsTitle : withDefault ( StringControl , trans ( "gaugeChart.defaultTitle" ) ) ,
255
282
echartsLegendConfig : EchartsLegendConfig ,
256
283
echartsLabelConfig : EchartsLabelConfig ,
@@ -267,6 +294,7 @@ let chartJsonModeChildren: any = {
267
294
bottom :withDefault ( NumberControl , trans ( 'gaugeChart.defaultBottom' ) ) ,
268
295
width :withDefault ( NumberControl , trans ( 'gaugeChart.defaultWidth' ) ) ,
269
296
radius :withDefault ( NumberControl , trans ( 'gaugeChart.defaultRadius' ) ) ,
297
+ temperatureRadius :withDefault ( NumberControl , trans ( 'gaugeChart.defaultTemperatureRadius' ) ) ,
270
298
min :withDefault ( NumberControl , trans ( 'gaugeChart.defaultMin' ) ) ,
271
299
max :withDefault ( NumberControl , trans ( 'gaugeChart.defaultMax' ) ) ,
272
300
gap :withDefault ( NumberControl , trans ( 'gaugeChart.defaultGap' ) ) ,
@@ -276,18 +304,43 @@ let chartJsonModeChildren: any = {
276
304
endAngle :withDefault ( NumberControl , trans ( 'gaugeChart.defaultEndAngle' ) ) ,
277
305
splitNumber :withDefault ( NumberControl , trans ( 'gaugeChart.defaultSplitNumber' ) ) ,
278
306
pointerLength :withDefault ( NumberControl , trans ( 'gaugeChart.defaultPointerLength' ) ) ,
307
+ barometerPointerLength :withDefault ( NumberControl , trans ( 'gaugeChart.defaultBarometerPointerLength' ) ) ,
279
308
pointerWidth :withDefault ( NumberControl , trans ( 'gaugeChart.defaultPointerWidth' ) ) ,
309
+ barometerPointerWidth :withDefault ( NumberControl , trans ( 'gaugeChart.defaultBarometerPointerWidth' ) ) ,
310
+ pointer_Y :withDefault ( NumberControl , trans ( 'gaugeChart.defaultPointer_Y' ) ) ,
311
+ barometerPointer_Y :withDefault ( NumberControl , trans ( 'gaugeChart.defaultBarometerPointer_Y' ) ) ,
312
+ pointerIcon :withDefault ( StringControl ) ,
313
+ gradePointerIcon :withDefault ( StringControl , trans ( 'gaugeChart.gradeDefaultPointerIcon' ) ) ,
314
+ clockPointerIcon :withDefault ( StringControl , trans ( 'gaugeChart.clockDefaultPointerIcon' ) ) ,
315
+ barometerPointerIcon :withDefault ( StringControl , trans ( 'gaugeChart.defaultBarometerPointerIcon' ) ) ,
316
+ multiTitlePointerIcon :withDefault ( StringControl , trans ( 'gaugeChart.defaultMultiTitlePointerIcon' ) ) ,
280
317
progressBarWidth :withDefault ( NumberControl , trans ( 'gaugeChart.defaultProgressBarWidth' ) ) ,
318
+ axisTickWidth : withDefault ( NumberControl , trans ( 'gaugeChart.defaultAxisTickWidth' ) ) ,
319
+ axisTickLength : withDefault ( NumberControl , trans ( 'gaugeChart.defaultAxisTickLength' ) ) ,
320
+ axisLabelDistance : withDefault ( NumberControl , trans ( 'gaugeChart.defaultAxisLabelDistance' ) ) ,
321
+ axisTickColor : withDefault ( ColorControl , trans ( 'gaugeChart.defaultAxisTickColor' ) ) ,
322
+
323
+ gradeGaugePointerLength :withDefault ( NumberControl , trans ( 'gaugeChart.defaultGradeGaugePointerLength' ) ) ,
324
+ gradeGaugePointerWidth :withDefault ( NumberControl , trans ( 'gaugeChart.defaultGradeGaugePointerWidth' ) ) ,
325
+ gradeGaugePointer_Y :withDefault ( NumberControl , trans ( 'gaugeChart.defaultGradeGaugePointer_Y' ) ) ,
326
+ stageProgressBarWidth :withDefault ( NumberControl , trans ( 'gaugeChart.defaultStageProgressBarWidth' ) ) ,
327
+ temperatureProgressBarWidth :withDefault ( NumberControl , trans ( 'gaugeChart.defaultTemperatureProgressBarWidth' ) ) ,
328
+ ringProgressBarWidth :withDefault ( NumberControl , trans ( 'gaugeChart.defaultRingProgressBarWidth' ) ) ,
329
+ temperatureAxisLabelDistance :withDefault ( NumberControl , trans ( 'gaugeChart.defaultTemperatureAxisLabelDistance' ) ) ,
330
+ stageAxisTickColor : withDefault ( ColorControl , trans ( 'gaugeChart.defaultStageAxisTickColor' ) ) ,
331
+ gradeAxisTickColor : withDefault ( ColorControl ) ,
281
332
282
333
}
283
- if ( EchartDefaultChartStyle && EchartDefaultTextStyle ) {
334
+
335
+ if ( EchartDefaultChartStyle && EchartDefaultTextStyle && EchartDefaultDetailStyle ) {
284
336
chartJsonModeChildren = {
285
337
...chartJsonModeChildren ,
286
338
chartStyle : styleControl ( EchartDefaultChartStyle , 'chartStyle' ) ,
287
339
titleStyle : styleControl ( EchartDefaultTextStyle , 'titleStyle' ) ,
288
340
labelStyle : styleControl ( EchartDefaultTextStyle , 'labelStyle' ) ,
289
- legendStyle : styleControl ( EchartDefaultTextStyle , 'legendStyle' ) ,
341
+ legendStyle : styleControl ( EchartDefaultDetailStyle , 'legendStyle' ) ,
290
342
axisLabelStyle : styleControl ( EchartDefaultTextStyle , 'axisLabelStyle' ) ,
343
+ axisLabelStyleOutline : styleControl ( EchartDefaultTextStyle , 'axisLabelStyleOutline' ) ,
291
344
}
292
345
}
293
346
const chartMapModeChildren = {
0 commit comments