Skip to content

Commit 53c76d1

Browse files
committed
Fixed legend option of funnel charts
1 parent 08d39d0 commit 53c76d1

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

client/packages/lowcoder-comps/src/comps/chartComp/chartConfigs/echartsLegendAlignConfig.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
dropdownControl,
66
MultiCompBuilder,
77
} from "lowcoder-sdk";
8-
import {FunnelSeriesOption, LegendComponentOption} from "echarts";
8+
import { LegendComponentOption } from "echarts";
99
import { trans } from "i18n/comps";
1010

1111
const FunnelLegnedAlignOptions = [
@@ -28,9 +28,10 @@ export const EchartsLegendAlignConfig = (function () {
2828
{
2929
legendAlign: dropdownControl(FunnelLegnedAlignOptions, "center"),
3030
},
31-
(props): FunnelSeriesOption => {
32-
const config: FunnelSeriesOption = {
33-
left: "center",
31+
(props): LegendComponentOption => {
32+
const config: LegendComponentOption = {
33+
left: "right",
34+
type: "scroll",
3435
};
3536
config.left = props.legendAlign
3637
return config;

client/packages/lowcoder-comps/src/comps/chartComp/chartConfigs/echartsLegendLayoutConfig.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ export const EchartsLegendLayoutConfig = (function () {
2525
},
2626
(props): LegendComponentOption => {
2727
const config: LegendComponentOption = {
28-
orient: "horizontal",
28+
orient: "vertical",
29+
type: "scroll"
2930
};
3031
config.orient = props.legendLayout
3132
return config;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ export function funnelChartPropertyView(
3434
{children.legendVisibility.getView()&& children.echartsLegendConfig.getPropertyView()}
3535
{children.echartsSortingConfig.getPropertyView()}
3636
{children.label.getView()&& children.echartsLabelConfig.getPropertyView()}
37-
{children.echartsLegendLayoutConfig.getPropertyView()}
38-
{children.echartsLegendAlignConfig.getPropertyView()}
39-
{children.echartsConfig.getPropertyView()}
37+
{children.echartsFunnelAlignConfig.getPropertyView()}
38+
{children.legendVisibility.getView() && children.echartsLegendLayoutConfig.getPropertyView()}
39+
{children.legendVisibility.getView() && children.echartsLegendAlignConfig.getPropertyView()}
4040
{children.echartsTitleConfig.getPropertyView()}
4141
{children.left.propertyView({ label: trans("funnelChart.left") })}
4242
{children.top.propertyView({ label: trans("funnelChart.top") })}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export function getEchartsConfig(
175175
"data": props.echartsOption.data?.map(data=>data.name),
176176
"top": props.echartsLegendConfig.top,
177177
"left": props.echartsLegendAlignConfig.left,
178-
"orient": props.echartsLegendAlignConfig.orient,
178+
"orient": props.echartsLegendLayoutConfig.orient,
179179
"textStyle": {
180180
"fontFamily": props?.legendStyle?.chartFontFamily || theme?.legendStyle?.fontFamily,
181181
"fontSize": props?.legendStyle?.chartTextSize || theme?.legendStyle?.fontSize,

0 commit comments

Comments
 (0)