Skip to content

Commit e46c7f6

Browse files
committed
Added axis style to Gauge chart.
1 parent 0992430 commit e46c7f6

File tree

5 files changed

+18
-0
lines changed

5 files changed

+18
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ if (EchartsStyle) {
287287
titleStyle: styleControl(EchartDefaultTextStyle, 'titleStyle'),
288288
labelStyle: styleControl(EchartDefaultTextStyle, 'labelStyle'),
289289
legendStyle: styleControl(EchartDefaultTextStyle, 'legendStyle'),
290+
axisLabelStyle: styleControl(EchartDefaultTextStyle, 'axisLabelStyle'),
290291
}
291292
}
292293
const chartMapModeChildren = {

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ export function gaugeChartPropertyView(
6767
<Section name={sectionNames.detailStyle}>
6868
{children.legendStyle?.getPropertyView()}
6969
</Section>
70+
<Section name={sectionNames.axisLabelStyle}>
71+
{children.axisLabelStyle?.getPropertyView()}
72+
</Section>
7073
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
7174
</>
7275
);

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,18 @@ export function getEchartsConfig(
217217
"width": props?.progressBarWidth
218218
}
219219
},
220+
"axisLabel": {
221+
"distance": props?.progressBarWidth + "10", // Distance of the labels from the axis
222+
"fontFamily": props?.axixLabelStyle?.chartFontFamily || theme?.axixLabelStyle?.fontFamily,
223+
"fontSize": props?.axixLabelStyle?.chartTextSize || theme?.axixLabelStyle?.fontSize || 12,
224+
"fontWeight": props?.axixLabelStyle?.chartTextWeight || theme?.axixLabelStyle?.fontWeight,
225+
"color": props?.axixLabelStyle?.chartTextColor || theme?.axixLabelStyle?.fontColor || "#000000",
226+
"fontStyle": props?.axixLabelStyle?.chartFontStyle || theme?.axixLabelStyle?.fontStyle,
227+
"textShadowColor": props?.axixLabelStyle?.chartShadowColor || theme?.axixLabelStyle?.shadowColor,
228+
"textShadowBlur": props?.axixLabelStyle?.chartBoxShadow?.split('px')[0] || theme?.axixLabelStyle?.boxShadow?.split('px')[0],
229+
"textShadowOffsetX": props?.axixLabelStyle?.chartBoxShadow?.split('px')[1] || theme?.axixLabelStyle?.boxShadow?.split('px')[1],
230+
"textShadowOffsetY": props?.axixLabelStyle?.chartBoxShadow?.split('px')[2] || theme?.axixLabelStyle?.boxShadow?.split('px')[2]
231+
},
220232
'detail': {
221233
"fontFamily": props?.legendStyle?.chartFontFamily || theme?.legendStyle?.fontFamily,
222234
"fontSize": props?.legendStyle?.chartTextSize || theme?.legendStyle?.fontSize || 16,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,5 @@ export const sectionNames = {
191191
titleStyle:trans("prop.titleStyle"),
192192
legendStyle:trans("prop.legendStyle"),
193193
detailStyle:trans("prop.detailStyle"),
194+
axisLabelStyle:trans("prop.axisLabelStyle"),
194195
};

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export const en = {
4444
titleStyle: "Title Style",
4545
legendStyle: "Legend Style",
4646
detailStyle: "Detail Style",
47+
axisLabelStyle: "Axis Label Style"
4748
},
4849
passwordInput: {
4950
label: "Password:",

0 commit comments

Comments
 (0)