Skip to content

Commit 712dae0

Browse files
committed
Added additional data input and moved options to Advanced.
1 parent cf5ff04 commit 712dae0

27 files changed

+314
-230
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ export const chartUiModeChildren = {
253253
};
254254

255255
let chartJsonModeChildren: any = {
256+
echartsData: withDefault(StringControl, trans("echarts.defaultTitle")),
256257
echartsOption: jsonControl(toObject, i18nObjs.defaultEchartsJsonOption),
257258
echartsTitle: withDefault(StringControl, trans("echarts.defaultTitle")),
258259
echartsLegendConfig: EchartsLegendConfig,

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ export function chartPropertyView(
2828
const uiModePropertyView = (
2929
<>
3030
<Section name={trans("chart.data")}>
31-
{children.data.propertyView({
32-
label: trans("chart.data"),
33-
})}
31+
{children.echartsData.propertyView({ label: trans("chart.data") })}
3432
<Dropdown
3533
value={children.chartConfig.children.compType.getView()}
3634
options={ChartTypeOptions}
@@ -151,6 +149,11 @@ export function chartPropertyView(
151149
<Section name={sectionNames.legendStyle}>
152150
{children.legendStyle?.getPropertyView()}
153151
</Section>
152+
<Section name={sectionNames.advanced}>
153+
{children.data.propertyView({
154+
label: trans("chart.data"),
155+
})}
156+
</Section>
154157
</>
155158
);
156159

client/packages/lowcoder-comps/src/comps/candleStickChartComp/candleStickChartConstants.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ export const chartUiModeChildren = {
250250
};
251251

252252
let chartJsonModeChildren: any = {
253+
echartsData: withDefault(StringControl, trans("candleStickChart.defaultTitle")),
253254
echartsOption: jsonControl(toObject, i18nObjs.defaultCandleStickChartOption),
254255
echartsTitle: withDefault(StringControl, trans("candleStickChart.defaultTitle")),
255256
echartsTitleVerticalConfig: EchartsTitleVerticalConfig,

client/packages/lowcoder-comps/src/comps/candleStickChartComp/candleStickChartPropertyView.tsx

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,7 @@ export function candleStickChartPropertyView(
1616
const jsonModePropertyView = (
1717
<>
1818
<Section name={trans("chart.config")}>
19-
{children.echartsOption.propertyView({
20-
label: trans("chart.echartsOptionLabel"),
21-
styleName: "higher",
22-
tooltip: (
23-
<div>
24-
<a href={optionUrl} target="_blank" rel="noopener noreferrer">
25-
{trans("chart.echartsOptionTooltip")}
26-
</a>
27-
<br />
28-
<a href={examplesUrl} target="_blank" rel="noopener noreferrer">
29-
{trans("chart.echartsOptionExamples")}
30-
</a>
31-
</div>
32-
),
33-
})}
19+
{children.echartsData.propertyView({ label: trans("chart.data") })}
3420
{children.echartsTitleConfig.getPropertyView()}
3521
{children.echartsTitleVerticalConfig.getPropertyView()}
3622
{children.echartsTitle.propertyView({ label: trans("candleStickChart.title"), tooltip: trans("echarts.titleTooltip") })}
@@ -61,6 +47,23 @@ export function candleStickChartPropertyView(
6147
<Section name={sectionNames.yAxisStyle}>
6248
{children.yAxisStyle?.getPropertyView()}
6349
</Section>
50+
<Section name={sectionNames.advanced}>
51+
{children.echartsOption.propertyView({
52+
label: trans("chart.echartsOptionLabel"),
53+
styleName: "higher",
54+
tooltip: (
55+
<div>
56+
<a href={optionUrl} target="_blank" rel="noopener noreferrer">
57+
{trans("chart.echartsOptionTooltip")}
58+
</a>
59+
<br />
60+
<a href={examplesUrl} target="_blank" rel="noopener noreferrer">
61+
{trans("chart.echartsOptionExamples")}
62+
</a>
63+
</div>
64+
),
65+
})}
66+
</Section>
6467
</>
6568
);
6669

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ export const chartUiModeChildren = {
263263
};
264264

265265
let chartJsonModeChildren: any = {
266+
echartsData: withDefault(StringControl, trans("echarts.defaultTitle")),
266267
echartsTitle: withDefault(StringControl, trans("echarts.defaultTitle")),
267268
echartsOption: jsonControl(toObject, i18nObjs.defaultEchartsJsonOption),
268269

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ export function chartPropertyView(
2727
const uiModePropertyView = (
2828
<>
2929
<Section name={trans("chart.data")}>
30-
{children.data.propertyView({
31-
label: trans("chart.data"),
32-
})}
30+
{children.echartsData.propertyView({ label: trans("chart.data") })}
3331
<Dropdown
3432
value={children.chartConfig.children.compType.getView()}
3533
options={ChartTypeOptions}
@@ -151,6 +149,11 @@ export function chartPropertyView(
151149
<Section name={sectionNames.legendStyle}>
152150
{children.legendStyle?.getPropertyView()}
153151
</Section>
152+
<Section name={sectionNames.advanced}>
153+
{children.data.propertyView({
154+
label: trans("chart.data"),
155+
})}
156+
</Section>
154157
</>
155158
);
156159

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ export const chartUiModeChildren = {
255255
};
256256

257257
let chartJsonModeChildren: any = {
258+
echartsData: withDefault(StringControl, trans("funnelChart.defaultTitle")),
258259
echartsOption: jsonControl(toObject, i18nObjs.defaultFunnelChartOption),
259260
echartsTitle: withDefault(StringControl, trans("funnelChart.defaultTitle")),
260261
echartsTitleVerticalConfig: EchartsTitleVerticalConfig,

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

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,8 @@ export function funnelChartPropertyView(
1616
const jsonModePropertyView = (
1717
<>
1818
<Section name={trans("chart.config")}>
19-
{children.echartsOption.propertyView({
20-
label: trans("chart.echartsOptionLabel"),
21-
styleName: "higher",
22-
tooltip: (
23-
<div>
24-
<a href={optionUrl} target="_blank" rel="noopener noreferrer">
25-
{trans("chart.echartsOptionTooltip")}
26-
</a>
27-
<br />
28-
<a href={examplesUrl} target="_blank" rel="noopener noreferrer">
29-
{trans("chart.echartsOptionExamples")}
30-
</a>
31-
</div>
32-
),
33-
})}
19+
{children.echartsData.propertyView({ label: trans("chart.data") })}
20+
3421
{children.echartsTitleConfig.getPropertyView()}
3522
{children.echartsTitleVerticalConfig.getPropertyView()}
3623
{children.legendVisibility.getView() && children.echartsLegendAlignConfig.getPropertyView()}
@@ -74,6 +61,23 @@ export function funnelChartPropertyView(
7461
</Section> : <></>
7562
}
7663
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
64+
<Section name={sectionNames.advanced}>
65+
{children.echartsOption.propertyView({
66+
label: trans("chart.echartsOptionLabel"),
67+
styleName: "higher",
68+
tooltip: (
69+
<div>
70+
<a href={optionUrl} target="_blank" rel="noopener noreferrer">
71+
{trans("chart.echartsOptionTooltip")}
72+
</a>
73+
<br />
74+
<a href={examplesUrl} target="_blank" rel="noopener noreferrer">
75+
{trans("chart.echartsOptionExamples")}
76+
</a>
77+
</div>
78+
),
79+
})}
80+
</Section>
7781
</>
7882
);
7983

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export function getEchartsConfig(
159159
"left": props.echartsLegendAlignConfig.left,
160160
"orient": props.echartsLegendOrientConfig.orient,
161161
"textStyle": {
162-
...styleWrapper(props?.legendStyle, theme?.legendStyle)
162+
...styleWrapper(props?.legendStyle, theme?.legendStyle, 13)
163163
}
164164
},
165165
"series": [
@@ -182,7 +182,7 @@ export function getEchartsConfig(
182182
"label": {
183183
"show": props.label,
184184
"position": props.echartsLabelConfig.top,
185-
...styleWrapper(props?.labelStyle,theme?.labelStyle),
185+
...styleWrapper(props?.labelStyle,theme?.labelStyle, 13),
186186
},
187187
"data": props.echartsOption.data
188188
}

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ export const chartUiModeChildren = {
268268
};
269269

270270
let chartJsonModeChildren: any = {
271+
echartsData: withDefault(StringControl, trans("funnelChart.defaultTitle")),
271272
echartsOption: jsonControl(toObject, i18nObjs.defaultGaugeChartOption),
272273
stageGaugeOption: jsonControl(toObject, i18nObjs.defaultStageGaugeChartOption),
273274
gradeGaugeOption: jsonControl(toObject, i18nObjs.defaultGradeGaugeChartOption),
@@ -277,6 +278,14 @@ let chartJsonModeChildren: any = {
277278
clockGaugeOption: jsonControl(toObject, i18nObjs.defaultClockGaugeChartOption),
278279
barometerGaugeOption: jsonControl(toObject, i18nObjs.defaultBarometerGaugeChartOption),
279280

281+
stageGaugeData:withDefault(StringControl, trans("gaugeChart.defaultTitle")),
282+
gradeGaugeData:withDefault(StringControl, trans("gaugeChart.defaultTitle")),
283+
temperatureGaugeData:withDefault(StringControl, trans("gaugeChart.defaultTitle")),
284+
multiTitleGaugeData:withDefault(StringControl, trans("gaugeChart.defaultTitle")),
285+
ringGaugeData:withDefault(StringControl, trans("gaugeChart.defaultTitle")),
286+
clockGaugeData:withDefault(StringControl, trans("gaugeChart.defaultTitle")),
287+
barometerGaugeData:withDefault(StringControl, trans("gaugeChart.defaultTitle")),
288+
280289
chartType: dropdownControl(ChartTypeOptions, trans("chart.default")),
281290
echartsTitle: withDefault(StringControl, trans("gaugeChart.defaultTitle")),
282291
echartsLegendConfig: EchartsLegendConfig,

0 commit comments

Comments
 (0)