Skip to content

Commit 492bc6c

Browse files
committed
theme for chart components
1 parent 3d616ae commit 492bc6c

22 files changed

+23
-23
lines changed

client/packages/lowcoder-comps/src/comps/basicChartComp/chartConstants.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,11 @@ export const chartUiModeChildren = {
251251

252252
const chartJsonModeChildren = {
253253
echartsOption: jsonControl(toObject, i18nObjs.defaultEchartsJsonOption),
254-
echartsTitle: withDefault(StringControl, trans("echarts.defaultTitle")),
254+
echartsTitle: withDefault(StringControl, trans("echarts.defaultTitle")),
255255
echartsLegendConfig: EchartsLegendConfig,
256256
echartsLabelConfig: EchartsLabelConfig,
257257
echartsConfig: EchartsOptionComp,
258-
style: styleControl(EchartsStyle),
258+
style: styleControl(EchartsStyle, 'style'),
259259
tooltip: withDefault(BoolControl, true),
260260
legendVisibility: withDefault(BoolControl, true),
261261
}

client/packages/lowcoder-comps/src/comps/basicChartComp/chartUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function getEchartsConfig(props: EchartsConfigProps, chartSize?: ChartSiz
136136
'top': props.echartsLegendConfig.top === 'bottom' ?'top':'bottom',
137137
"left":"center"
138138
},
139-
"backgroundColor": props?.style?.background,
139+
"backgroundColor": props?.style?.background || theme?.style?.background,
140140
"color": props.echartsOption.data?.map(data => data.color),
141141
"tooltip": props.tooltip&&{
142142
"trigger": "item",

client/packages/lowcoder-comps/src/comps/funnelChartComp/funnelChartConstants.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ const chartJsonModeChildren = {
255255
echartsLabelConfig: EchartsLabelConfig,
256256
echartsConfig: EchartsOptionComp,
257257
echartsTitleConfig:EchartsTitleConfig,
258-
style: styleControl(EchartsStyle),
258+
style: styleControl(EchartsStyle, 'style'),
259259
tooltip: withDefault(BoolControl, true),
260260
label: withDefault(BoolControl, true),
261261
legendVisibility: withDefault(BoolControl, true),

client/packages/lowcoder-comps/src/comps/funnelChartComp/funnelChartUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function getEchartsConfig(props: EchartsConfigProps, chartSize?: ChartSiz
136136
'top': props.echartsLegendConfig.top === 'bottom' ?'top':'bottom',
137137
"left":props.echartsTitleConfig.top
138138
},
139-
"backgroundColor": props?.style?.background,
139+
"backgroundColor": props?.style?.background || theme?.style?.background,
140140
"color": props.echartsOption.data?.map(data => data.color),
141141
"tooltip": props.tooltip&&{
142142
"trigger": "item",

client/packages/lowcoder-comps/src/comps/gaugeChartComp/gaugeChartConstants.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ const chartJsonModeChildren = {
255255
echartsLabelConfig: EchartsLabelConfig,
256256
echartsConfig: EchartsOptionComp,
257257
echartsTitleConfig:EchartsTitleConfig,
258-
style: styleControl(EchartsStyle),
258+
style: styleControl(EchartsStyle, 'style'),
259259
tooltip: withDefault(BoolControl, true),
260260
legendVisibility: withDefault(BoolControl, true),
261261
label: withDefault(BoolControl, true),

client/packages/lowcoder-comps/src/comps/gaugeChartComp/gaugeChartUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function getEchartsConfig(props: EchartsConfigProps, chartSize?: ChartSiz
136136
'top': props.echartsLegendConfig.top === 'bottom' ?'top':'bottom',
137137
"left":props.echartsTitleConfig.top
138138
},
139-
"backgroundColor": props?.style?.background,
139+
"backgroundColor": props?.style?.background || theme?.style?.background,
140140
"color": props.echartsOption.data?.map(data => data.color),
141141
"tooltip": props.tooltip&&{
142142
"trigger": "item",

client/packages/lowcoder-comps/src/comps/graphChartComp/graphChartConstants.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ const chartJsonModeChildren = {
253253
echartsLegendConfig: EchartsLegendConfig,
254254
echartsLabelConfig: EchartsLabelConfig,
255255
echartsConfig: EchartsOptionComp,
256-
style: styleControl(EchartsStyle),
256+
style: styleControl(EchartsStyle, 'style'),
257257
tooltip: withDefault(BoolControl, true),
258258
legendVisibility: withDefault(BoolControl, true),
259259
}

client/packages/lowcoder-comps/src/comps/graphChartComp/graphChartUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function getEchartsConfig(props: EchartsConfigProps, chartSize?: ChartSiz
136136
'top': props.echartsLegendConfig.top === 'bottom' ?'top':'bottom',
137137
"left":"center"
138138
},
139-
"backgroundColor": props?.style?.background,
139+
"backgroundColor": props?.style?.background || theme?.style?.background,
140140
"color": props.echartsOption.data?.map(data => data.color),
141141
"tooltip": props.tooltip&& {
142142
"trigger": "item"

client/packages/lowcoder-comps/src/comps/heatmapChartComp/heatmapChartConstants.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ const chartJsonModeChildren = {
253253
echartsLegendConfig: EchartsLegendConfig,
254254
echartsLabelConfig: EchartsLabelConfig,
255255
echartsConfig: EchartsOptionComp,
256-
style: styleControl(EchartsStyle),
256+
style: styleControl(EchartsStyle, 'style'),
257257
tooltip: withDefault(BoolControl, true),
258258
legendVisibility: withDefault(BoolControl, true),
259259
}

client/packages/lowcoder-comps/src/comps/heatmapChartComp/heatmapChartUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function getEchartsConfig(props: EchartsConfigProps, chartSize?: ChartSiz
136136
'top': props.echartsLegendConfig.top === 'bottom' ?'top':'bottom',
137137
"left":"center"
138138
},
139-
"backgroundColor": props?.style?.background,
139+
"backgroundColor": props?.style?.background || theme?.style?.background,
140140
"color": props.echartsOption.data?.map(data => data.color),
141141
"tooltip": props.tooltip&&{
142142
"position": "top"

client/packages/lowcoder-comps/src/comps/radarChartComp/radarChartConstants.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ const chartJsonModeChildren = {
253253
echartsLegendConfig: EchartsLegendConfig,
254254
echartsLabelConfig: EchartsLabelConfig,
255255
echartsConfig: EchartsOptionComp,
256-
style: styleControl(EchartsStyle),
256+
style: styleControl(EchartsStyle, 'style'),
257257
tooltip: withDefault(BoolControl, true),
258258
legendVisibility: withDefault(BoolControl, true),
259259
}

client/packages/lowcoder-comps/src/comps/radarChartComp/radarChartUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function getEchartsConfig(props: EchartsConfigProps, chartSize?: ChartSiz
136136
'top': props.echartsLegendConfig.top === 'bottom' ?'top':'bottom',
137137
"left":"center"
138138
},
139-
"backgroundColor": props?.style?.background,
139+
"backgroundColor": props?.style?.background || theme?.style?.background,
140140
"color": props.echartsOption.data?.map(data => data.color),
141141
"tooltip": {
142142
"trigger": "axis",

client/packages/lowcoder-comps/src/comps/sankeyChartComp/sankeyChartConstants.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ const chartJsonModeChildren = {
253253
echartsLegendConfig: EchartsLegendConfig,
254254
echartsLabelConfig: EchartsLabelConfig,
255255
echartsConfig: EchartsOptionComp,
256-
style: styleControl(EchartsStyle),
256+
style: styleControl(EchartsStyle, 'style'),
257257
tooltip: withDefault(BoolControl, true),
258258
legendVisibility: withDefault(BoolControl, true),
259259
}

client/packages/lowcoder-comps/src/comps/sankeyChartComp/sankeyChartUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function getEchartsConfig(props: EchartsConfigProps, chartSize?: ChartSiz
136136
'top': props.echartsLegendConfig.top === 'bottom' ?'top':'bottom',
137137
"left":"center"
138138
},
139-
"backgroundColor": props?.style?.background,
139+
"backgroundColor": props?.style?.background || theme?.style?.background,
140140
"color": props.echartsOption.data?.map(data => data.color),
141141
"tooltip": props.tooltip&&{
142142
"trigger": "item",

client/packages/lowcoder-comps/src/comps/sunburstChartComp/sunburstChartConstants.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ const chartJsonModeChildren = {
253253
echartsLegendConfig: EchartsLegendConfig,
254254
echartsLabelConfig: EchartsLabelConfig,
255255
echartsConfig: EchartsOptionComp,
256-
style: styleControl(EchartsStyle),
256+
style: styleControl(EchartsStyle, 'style'),
257257
tooltip: withDefault(BoolControl, true),
258258
legendVisibility: withDefault(BoolControl, true),
259259
}

client/packages/lowcoder-comps/src/comps/sunburstChartComp/sunburstChartUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function getEchartsConfig(props: EchartsConfigProps, chartSize?: ChartSiz
136136
'top': props.echartsLegendConfig.top === 'bottom' ?'top':'bottom',
137137
"left":"center"
138138
},
139-
"backgroundColor": props?.style?.background,
139+
"backgroundColor": props?.style?.background || theme?.style?.background,
140140
"color": props.echartsOption.data?.map(data => data.color),
141141
"tooltip": props.tooltip&&{
142142
"trigger": "item",

client/packages/lowcoder-comps/src/comps/themeriverChartComp/themeriverChartConstants.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ const chartJsonModeChildren = {
253253
echartsLegendConfig: EchartsLegendConfig,
254254
echartsLabelConfig: EchartsLabelConfig,
255255
echartsConfig: EchartsOptionComp,
256-
style: styleControl(EchartsStyle),
256+
style: styleControl(EchartsStyle, 'style'),
257257
tooltip: withDefault(BoolControl, true),
258258
legendVisibility: withDefault(BoolControl, true),
259259
}

client/packages/lowcoder-comps/src/comps/themeriverChartComp/themeriverChartUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function getEchartsConfig(props: EchartsConfigProps, chartSize?: ChartSiz
136136
'top': props.echartsLegendConfig.top === 'bottom' ?'top':'bottom',
137137
"left":"center"
138138
},
139-
"backgroundColor": props.style.background,
139+
"backgroundColor": props?.style?.background || theme?.style?.background,
140140
"tooltip": props.tooltip&&{
141141
"trigger": "axis",
142142
"axisPointer": {

client/packages/lowcoder-comps/src/comps/treeChartComp/treeChartConstants.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ const chartJsonModeChildren = {
253253
echartsLegendConfig: EchartsLegendConfig,
254254
echartsLabelConfig: EchartsLabelConfig,
255255
echartsConfig: EchartsOptionComp,
256-
style: styleControl(EchartsStyle),
256+
style: styleControl(EchartsStyle, 'style'),
257257
tooltip: withDefault(BoolControl, true),
258258
legendVisibility: withDefault(BoolControl, true),
259259
}

client/packages/lowcoder-comps/src/comps/treeChartComp/treeChartUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function getEchartsConfig(props: EchartsConfigProps, chartSize?: ChartSiz
136136
'top': props.echartsLegendConfig.top === 'bottom' ?'top':'bottom',
137137
"left":"center"
138138
},
139-
"backgroundColor": props?.style?.background,
139+
"backgroundColor": props?.style?.background || theme?.style?.background,
140140
"color": props.echartsOption.data?.map(data => data.color),
141141
"tooltip": props.tooltip&&{
142142
"trigger": "item",

client/packages/lowcoder-comps/src/comps/treemapChartComp/treemapChartConstants.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ const chartJsonModeChildren = {
253253
echartsLegendConfig: EchartsLegendConfig,
254254
echartsLabelConfig: EchartsLabelConfig,
255255
echartsConfig: EchartsOptionComp,
256-
style: styleControl(EchartsStyle),
256+
style: styleControl(EchartsStyle, 'style'),
257257
tooltip: withDefault(BoolControl, true),
258258
legendVisibility: withDefault(BoolControl, true),
259259
}

client/packages/lowcoder-comps/src/comps/treemapChartComp/treemapChartUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function getEchartsConfig(props: EchartsConfigProps, chartSize?: ChartSiz
136136
'top': props.echartsLegendConfig.top === 'bottom' ?'top':'bottom',
137137
"left":"center"
138138
},
139-
"backgroundColor": props?.style?.background,
139+
"backgroundColor": props?.style?.background || theme?.style?.background,
140140
"color": [],
141141
"tooltip": props.tooltip&&{
142142
"trigger": "item",

0 commit comments

Comments
 (0)