@@ -17,7 +17,9 @@ import {
1717 clickEvent ,
1818 styleControl ,
1919 EchartDefaultChartStyle ,
20- EchartDefaultTextStyle
20+ EchartDefaultTextStyle ,
21+ ColorControl ,
22+ EchartDefaultDetailStyle
2123} from "lowcoder-sdk" ;
2224import { RecordConstructorToComp , RecordConstructorToView } from "lowcoder-core" ;
2325import { BarChartConfig } from "../chartComp/chartConfigs/barChartConfig" ;
@@ -34,25 +36,6 @@ import { i18nObjs, trans } from "i18n/comps";
3436import { GaugeChartConfig } from "../chartComp/chartConfigs/gaugeChartConfig" ;
3537import { EchartsTitleConfig } from "comps/chartComp/chartConfigs/echartsTitleConfig" ;
3638
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-
5639export const UIEventOptions = [
5740 {
5841 label : trans ( "chart.select" ) ,
@@ -232,6 +215,41 @@ const EchartsOptionMap = {
232215 gauge : GaugeChartConfig ,
233216} ;
234217
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+
235253const ChartOptionComp = withType ( ChartOptionMap , "bar" ) ;
236254const EchartsOptionComp = withType ( EchartsOptionMap , "gauge" ) ;
237255export type CharOptionCompType = keyof typeof ChartOptionMap ;
@@ -251,6 +269,15 @@ export const chartUiModeChildren = {
251269
252270let chartJsonModeChildren : any = {
253271 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" ) ) ,
254281 echartsTitle : withDefault ( StringControl , trans ( "gaugeChart.defaultTitle" ) ) ,
255282 echartsLegendConfig : EchartsLegendConfig ,
256283 echartsLabelConfig : EchartsLabelConfig ,
@@ -267,6 +294,7 @@ let chartJsonModeChildren: any = {
267294 bottom :withDefault ( NumberControl , trans ( 'gaugeChart.defaultBottom' ) ) ,
268295 width :withDefault ( NumberControl , trans ( 'gaugeChart.defaultWidth' ) ) ,
269296 radius :withDefault ( NumberControl , trans ( 'gaugeChart.defaultRadius' ) ) ,
297+ temperatureRadius :withDefault ( NumberControl , trans ( 'gaugeChart.defaultTemperatureRadius' ) ) ,
270298 min :withDefault ( NumberControl , trans ( 'gaugeChart.defaultMin' ) ) ,
271299 max :withDefault ( NumberControl , trans ( 'gaugeChart.defaultMax' ) ) ,
272300 gap :withDefault ( NumberControl , trans ( 'gaugeChart.defaultGap' ) ) ,
@@ -276,18 +304,43 @@ let chartJsonModeChildren: any = {
276304 endAngle :withDefault ( NumberControl , trans ( 'gaugeChart.defaultEndAngle' ) ) ,
277305 splitNumber :withDefault ( NumberControl , trans ( 'gaugeChart.defaultSplitNumber' ) ) ,
278306 pointerLength :withDefault ( NumberControl , trans ( 'gaugeChart.defaultPointerLength' ) ) ,
307+ barometerPointerLength :withDefault ( NumberControl , trans ( 'gaugeChart.defaultBarometerPointerLength' ) ) ,
279308 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' ) ) ,
280317 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 ) ,
281332
282333}
283- if ( EchartDefaultChartStyle && EchartDefaultTextStyle ) {
334+
335+ if ( EchartDefaultChartStyle && EchartDefaultTextStyle && EchartDefaultDetailStyle ) {
284336 chartJsonModeChildren = {
285337 ...chartJsonModeChildren ,
286338 chartStyle : styleControl ( EchartDefaultChartStyle , 'chartStyle' ) ,
287339 titleStyle : styleControl ( EchartDefaultTextStyle , 'titleStyle' ) ,
288340 labelStyle : styleControl ( EchartDefaultTextStyle , 'labelStyle' ) ,
289- legendStyle : styleControl ( EchartDefaultTextStyle , 'legendStyle' ) ,
341+ legendStyle : styleControl ( EchartDefaultDetailStyle , 'legendStyle' ) ,
290342 axisLabelStyle : styleControl ( EchartDefaultTextStyle , 'axisLabelStyle' ) ,
343+ axisLabelStyleOutline : styleControl ( EchartDefaultTextStyle , 'axisLabelStyleOutline' ) ,
291344 }
292345}
293346const chartMapModeChildren = {
0 commit comments