Skip to content

Commit 3421f8c

Browse files
committed
legend and title position and tooltip visibility
1 parent 98cfff3 commit 3421f8c

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,8 @@ const chartJsonModeChildren = {
267267
echartsLabelConfig: EchartsLabelConfig,
268268
echartsConfig: EchartsOptionComp,
269269
style: styleControl(EchartsStyle),
270+
tooltip: withDefault(BoolControl, true),
271+
legendVisibility: withDefault(BoolControl, true),
270272
}
271273

272274
const chartMapModeChildren = {

client/packages/lowcoder-comps/src/comps/chartComp/chartPropertyView.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ export function chartPropertyView(
178178
{children.echartsLabelConfig.getPropertyView()}
179179
</>}
180180
{children.echartsTitle.propertyView({ label: trans("echarts.title") })}
181+
{children.tooltip.propertyView({label: trans("echarts.tooltip")})}
182+
{children.legendVisibility.propertyView({label: trans("echarts.legendVisibility")})}
181183
</Section>
182184
<Section name={sectionNames.interaction}>
183185
{children.onEvent.propertyView()}

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,16 @@ export function getEchartsConfig(props: EchartsConfigProps, chartSize?: ChartSiz
133133
let opt={
134134
"title": {
135135
"text": props.echartsTitle,
136-
"left": "center"
136+
'top': props.echartsLegendConfig.top === 'bottom' ?'top':'bottom',
137+
"left":"center"
137138
},
138139
"backgroundColor": props?.style?.background,
139140
"color":props?.style?.color,
140-
"tooltip": {
141+
"tooltip": props.tooltip&&{
141142
"trigger": "item",
142143
"formatter": "{a} <br/>{b} : {c}%"
143144
},
144-
"legend": {
145+
"legend":props.legendVisibility&& {
145146
"data": [
146147
"Show",
147148
"Click",

0 commit comments

Comments
 (0)