Skip to content

Commit 55e43b2

Browse files
committed
Add label toggle in the TreeChart
1 parent 71a498e commit 55e43b2

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ let chartJsonModeChildren: any = {
273273
edgeShape: withDefault(BoolControl, true),
274274
tooltip: withDefault(BoolControl, true),
275275
legendVisibility: withDefault(BoolControl, true),
276+
labelVisibility: withDefault(BoolControl, true),
276277
}
277278

278279
if (RadarLabelStyle && EchartDefaultChartStyle && EchartDefaultTextStyle) {

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ export function treeChartPropertyView(
2929
{children.lineWidth.propertyView({ label: trans("treeChart.lineWidth"), tooltip: trans("treeChart.lineWidthTooltip") })}
3030

3131
{children.tooltip.propertyView({label: trans("treeChart.tooltip")})}
32+
{children.labelVisibility.propertyView({
33+
label: trans("treeChart.labelVisibility"),
34+
tooltip: trans("echarts.labelVisibilityTooltip")
35+
})}
3236

3337
</Section>
3438
<Section name={sectionNames.interaction}>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ export function getEchartsConfig(
163163
symbolSize: props?.pointSize || 20, // Control the size of the nodes
164164
data: props?.echartsData.length !== 0 && props?.echartsData || props.echartsOption.data,
165165
label: {
166+
show: props?.labelVisibility,
166167
position: "top",
167168
verticalAlign: "middle",
168169
align: "right",

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ export const en = {
7676
pointSizeTooltip: "Set the Point Size of the Chart.",
7777
defaultlineWidth: '2',
7878
lineWidth: "Line Width",
79-
lineWidthTooltip: "Set the Line Width of the Chart."
79+
lineWidthTooltip: "Set the Line Width of the Chart.",
80+
labelVisibility: "Label",
81+
labelVisibilityTooltip: "Show or hide the Label of the Chart."
8082
},
8183
graphChart: {
8284
categories: 'Categories',

0 commit comments

Comments
 (0)