Skip to content

Commit 1d062e0

Browse files
committed
Added legend font settings.
1 parent 4f9b411 commit 1d062e0

File tree

5 files changed

+31
-8
lines changed

5 files changed

+31
-8
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ if (EchartsStyle) {
281281
...chartJsonModeChildren,
282282
style: styleControl(FunnelStyle, 'style'),
283283
titleStyle: styleControl(FunnelStyle, 'titleStyle'),
284+
legendStyle: styleControl(FunnelStyle, 'legendStyle'),
284285
chartStyle: styleControl(FunnelChartStyle, 'chartStyle')
285286
}
286287
}

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,18 @@ export function funnelChartPropertyView(
5858
<Section name={sectionNames.titleStyle}>
5959
{children.titleStyle?.getPropertyView()}
6060
</Section>
61-
<Section name={sectionNames.labelStyle}>
61+
{
62+
children.label.getView() ?
63+
<Section name={sectionNames.labelStyle}>
6264
{children.style?.getPropertyView()}
63-
</Section>
65+
</Section> : <></>
66+
}
67+
{
68+
children.legendVisibility.getView() ?
69+
<Section name={sectionNames.legendStyle}>
70+
{children.legendStyle?.getPropertyView()}
71+
</Section> : <></>
72+
}
6473
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
6574
</>
6675
);

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ export function getEchartsConfig(
143143
'top': props.echartsLegendConfig.top === 'bottom' ?'top':'bottom',
144144
"left":props.echartsTitleConfig.top,
145145
"textStyle": {
146-
"fontFamily": props?.titleStyle?.fontFamily || theme?.style?.fontFamily,
147-
"fontSize": props?.titleStyle?.textSize || theme?.style?.textSize,
148-
"fontWeight": props?.titleStyle?.textWeight || theme?.style?.textWeight,
149-
"color": props?.titleStyle?.text || theme?.style?.text,
146+
"fontFamily": props?.titleStyle?.fontFamily || theme?.style?.fontFamily || "Arial",
147+
"fontSize": props?.titleStyle?.textSize || theme?.style?.textSize || 18,
148+
"fontWeight": props?.titleStyle?.textWeight || theme?.style?.textWeight || "bold",
149+
"color": props?.titleStyle?.text || theme?.style?.text || "#333",
150150
"fontStyle": props?.titleStyle?.fontStyle || theme?.style?.fontStyle,
151151
"textShadowColor": props?.titleStyle?.boxShadowColor || theme?.style?.boxShadowColor,
152152
"textShadowBlur": props?.titleStyle?.boxShadow?.split(' ')[0],
@@ -163,6 +163,17 @@ export function getEchartsConfig(
163163
"legend":props.legendVisibility&& {
164164
"data": props.echartsOption.data?.map(data=>data.name),
165165
"top": props.echartsLegendConfig.top,
166+
"textStyle": {
167+
"fontFamily": props?.legendStyle?.fontFamily || theme?.style?.fontFamily || "Arial",
168+
"fontSize": props?.legendStyle?.textSize || theme?.style?.textSize,
169+
"fontWeight": props?.legendStyle?.textWeight || theme?.style?.textWeight,
170+
"color": props?.legendStyle?.text || theme?.style?.text || "#000000",
171+
"fontStyle": props?.legendStyle?.fontStyle || theme?.style?.fontStyle,
172+
"textShadowColor": props?.legendStyle?.boxShadowColor || theme?.style?.boxShadowColor,
173+
"textShadowBlur": props?.legendStyle?.boxShadow?.split(' ')[0],
174+
"textShadowOffsetX": props?.legendStyle?.boxShadow?.split(' ')[1],
175+
"textShadowOffsetY": props?.legendStyle?.boxShadow?.split(' ')[2]
176+
}
166177
},
167178
"series": [
168179
{
@@ -191,7 +202,7 @@ export function getEchartsConfig(
191202
"label": {
192203
"show": props.label,
193204
"position": props.echartsLabelConfig.top,
194-
"fontFamily": props?.style?.fontFamily || theme?.style?.fontFamily,
205+
"fontFamily": props?.style?.fontFamily || theme?.style?.fontFamily || "Arial",
195206
"fontSize": props?.style?.textSize || theme?.style?.textSize,
196207
"fontWeight": props?.style?.textWeight || theme?.style?.textWeight,
197208
"color": props?.style?.text || theme?.style?.text,

client/packages/lowcoder-design/src/components/Section.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,5 @@ export const sectionNames = {
189189
modalStyle:trans("prop.modalStyle"),
190190
chartStyle:trans("prop.chartStyle"),
191191
titleStyle:trans("prop.titleStyle"),
192+
legendStyle:trans("prop.legendStyle"),
192193
};

client/packages/lowcoder-design/src/i18n/design/locales/en.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ export const en = {
4141
columnStyle: 'Column Style',
4242
modalStyle: 'Modal Style',
4343
chartStyle: "Chart Style",
44-
titleStyle: "Title Style"
44+
titleStyle: "Title Style",
45+
legendStyle: "Legend Style",
4546
},
4647
passwordInput: {
4748
label: "Password:",

0 commit comments

Comments
 (0)