Skip to content

Commit ee0161b

Browse files
committed
Added font settings.
1 parent f006f89 commit ee0161b

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ import {
1616
uiChildren,
1717
clickEvent,
1818
styleControl,
19-
EchartsStyle
19+
EchartsStyle,
20+
TextStyle,
21+
FunnelStyle,
22+
FunnelChartStyle
2023
} from "lowcoder-sdk";
2124
import { RecordConstructorToComp, RecordConstructorToView } from "lowcoder-core";
2225
import { BarChartConfig } from "../chartComp/chartConfigs/barChartConfig";
@@ -33,7 +36,7 @@ import { EChartsOption } from "echarts";
3336
import { i18nObjs, trans } from "i18n/comps";
3437
import { FunnelChartConfig} from "../chartComp/chartConfigs/funnelChartConfig";
3538
import { EchartsTitleConfig } from "comps/chartComp/chartConfigs/echartsTitleConfig";
36-
import {EchartsSortingConfig} from "../chartComp/chartConfigs/echartsSortingConfig";
39+
import { EchartsSortingConfig } from "../chartComp/chartConfigs/echartsSortingConfig";
3740

3841
export const ChartTypeOptions = [
3942
{
@@ -272,13 +275,17 @@ let chartJsonModeChildren: any = {
272275
gap:withDefault(NumberControl,trans('funnelChart.defaultGap')),
273276
opacity:withDefault(NumberControl,trans('funnelChart.defaultOpacity'))
274277
}
278+
275279
if (EchartsStyle) {
276280
chartJsonModeChildren = {
277281
...chartJsonModeChildren,
278-
style: styleControl(EchartsStyle, 'style'),
282+
style: styleControl(FunnelStyle, 'style'),
283+
chartStyle: styleControl(FunnelChartStyle, 'style')
279284
}
280285
}
281286

287+
console.log(FunnelStyle)
288+
282289
const chartMapModeChildren = {
283290
mapInstance: stateComp(),
284291
getMapInstance: FunctionControl,

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,16 @@ export function getEchartsConfig(
168168
},
169169
"label": {
170170
"show": props.label,
171-
"position": props.echartsLabelConfig.top
171+
"position": props.echartsLabelConfig.top,
172+
"fontFamily": props?.style?.fontFamily || theme?.style?.fontFamily,
173+
"fontSize": props?.style?.textSize || theme?.style?.textSize,
174+
"fontWeight": props?.style?.textWeight || theme?.style?.textWeight,
175+
"color": props?.style?.text || theme?.style?.text,
176+
"fontStyle": props?.style?.fontStyle || theme?.style?.fontStyle,
177+
"textShadowColor": props?.style?.boxShadowColor || theme?.style?.boxShadowColor,
178+
"textShadowBlur": props?.style?.boxShadow?.split(' ')[0],
179+
"textShadowOffsetX": props?.style?.boxShadow?.split(' ')[1],
180+
"textShadowOffsetY": props?.style?.boxShadow?.split(' ')[2]
172181
},
173182
"data": props.echartsOption.data
174183
}

client/packages/lowcoder/src/comps/controls/styleControlConstants.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,25 @@ export const JsonEditorStyle = [LABEL] as const;
17931793

17941794
export const EchartsStyle = [getBackground("primarySurface")] as const;
17951795

1796+
export const FunnelStyle = [
1797+
getBackground("primarySurface"),
1798+
TEXT,
1799+
TEXT_SIZE,
1800+
TEXT_WEIGHT,
1801+
FONT_FAMILY,
1802+
FONT_STYLE,
1803+
BOXSHADOWCOLOR,
1804+
BOXSHADOW,
1805+
] as const;
1806+
1807+
export const FunnelChartStyle = [
1808+
OPACITY,
1809+
BORDER,
1810+
BORDER_STYLE,
1811+
RADIUS,
1812+
BORDER_WIDTH,
1813+
] as const;
1814+
17961815
export const CalendarStyle = [
17971816
getBackground("primarySurface"),
17981817
{

0 commit comments

Comments
 (0)