Skip to content

Commit 319a002

Browse files
committed
Added control fields and style fields to heatmap charts.
1 parent 31ddc52 commit 319a002

File tree

11 files changed

+217
-117
lines changed

11 files changed

+217
-117
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { EchartsTitleConfig } from "comps/chartComp/chartConfigs/echartsTitleCon
3737
import { EchartsSortingConfig } from "../chartComp/chartConfigs/echartsSortingConfig";
3838
import { EchartsLegendAlignConfig } from "../chartComp/chartConfigs/echartsLegendAlignConfig";
3939
import { EchartsLegendOrientConfig } from "../chartComp/chartConfigs/echartsLegendOrientConfig";
40+
import { EchartsTitleVerticalConfig } from "../chartComp/chartConfigs/echartsTitleVerticalConfig";
4041

4142
export const ChartTypeOptions = [
4243
{
@@ -256,10 +257,11 @@ export const chartUiModeChildren = {
256257
let chartJsonModeChildren: any = {
257258
echartsOption: jsonControl(toObject, i18nObjs.defaultFunnelChartOption),
258259
echartsTitle: withDefault(StringControl, trans("funnelChart.defaultTitle")),
259-
echartsLegendConfig: EchartsLegendConfig,
260+
echartsTitleVerticalConfig: EchartsTitleVerticalConfig,
260261
echartsSortingConfig: EchartsSortingConfig,
261262
echartsLabelConfig: EchartsLabelConfig,
262263
echartsFunnelAlignConfig: EchartsFunnelAlignConfig,
264+
echartsLegendConfig: EchartsLegendConfig,
263265
echartsLegendOrientConfig: EchartsLegendOrientConfig,
264266
echartsLegendAlignConfig: EchartsLegendAlignConfig,
265267
echartsConfig: EchartsOptionComp,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ export function funnelChartPropertyView(
3232
),
3333
})}
3434
{children.echartsTitleConfig.getPropertyView()}
35-
{children.legendVisibility.getView() && children.echartsLegendConfig.getPropertyView()}
35+
{children.echartsTitleVerticalConfig.getPropertyView()}
3636
{children.legendVisibility.getView() && children.echartsLegendAlignConfig.getPropertyView()}
37+
{children.legendVisibility.getView() && children.echartsLegendConfig.getPropertyView()}
3738
{children.legendVisibility.getView() && children.echartsLegendOrientConfig.getPropertyView()}
3839
{children.echartsSortingConfig.getPropertyView()}
3940
{children.label.getView()&& children.echartsLabelConfig.getPropertyView()}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export function getEchartsConfig(
140140
let opt={
141141
"title": {
142142
"text": props.echartsTitle,
143-
'top': "top",
143+
"top": props.echartsTitleVerticalConfig.top,
144144
"left":props.echartsTitleConfig.top,
145145
"textStyle": {
146146
"fontFamily": props?.titleStyle?.chartFontFamily || theme?.titleStyle?.fontFamily,

client/packages/lowcoder-comps/src/comps/heatmapChartComp/heatmapChartComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ HeatmapChartTmpComp = withViewFn(HeatmapChartTmpComp, (comp) => {
145145
return getEchartsConfig(
146146
childrenToProps(echartsConfigChildren) as ToViewReturn<typeof echartsConfigChildren>,
147147
chartSize,
148-
theme?.theme?.components?.candleStickChart || {},
148+
themeConfig
149149
);
150150
}, [chartSize, ...Object.values(echartsConfigChildren)]);
151151

client/packages/lowcoder-comps/src/comps/heatmapChartComp/heatmapChartConstants.tsx

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import {
1616
uiChildren,
1717
clickEvent,
1818
styleControl,
19-
EchartsStyle
19+
EchartDefaultTextStyle,
20+
EchartDefaultChartStyle
2021
} from "lowcoder-sdk";
2122
import { RecordConstructorToComp, RecordConstructorToView } from "lowcoder-core";
2223
import { BarChartConfig } from "../chartComp/chartConfigs/barChartConfig";
@@ -25,12 +26,16 @@ import { LegendConfig } from "../chartComp/chartConfigs/legendConfig";
2526
import { EchartsLegendConfig } from "../chartComp/chartConfigs/echartsLegendConfig";
2627
import { EchartsLabelConfig } from "../chartComp/chartConfigs/echartsLabelConfig";
2728
import { LineChartConfig } from "../chartComp/chartConfigs/lineChartConfig";
29+
import { EchartsTitleVerticalConfig } from "../chartComp/chartConfigs/echartsTitleVerticalConfig";
30+
import { EchartsTitleConfig } from "comps/chartComp/chartConfigs/echartsTitleConfig";
2831
import { PieChartConfig } from "../chartComp/chartConfigs/pieChartConfig";
2932
import { ScatterChartConfig } from "../chartComp/chartConfigs/scatterChartConfig";
3033
import { SeriesListComp } from "../chartComp/seriesComp";
3134
import { EChartsOption } from "echarts";
3235
import { i18nObjs, trans } from "i18n/comps";
3336
import { HeatmapChartConfig } from "comps/chartComp/chartConfigs/heatmapChartConfig";
37+
import {EchartsLegendOrientConfig} from "../chartComp/chartConfigs/echartsLegendOrientConfig";
38+
import {EchartsLegendAlignConfig} from "../chartComp/chartConfigs/echartsLegendAlignConfig";
3439

3540
export const ChartTypeOptions = [
3641
{
@@ -252,15 +257,34 @@ let chartJsonModeChildren: any = {
252257
echartsTitle: withDefault(StringControl, trans("heatmapChart.defaultTitle")),
253258
echartsLegendConfig: EchartsLegendConfig,
254259
echartsLabelConfig: EchartsLabelConfig,
260+
echartsTitleVerticalConfig: EchartsTitleVerticalConfig,
261+
echartsTitleConfig:EchartsTitleConfig,
262+
echartsLegendOrientConfig: EchartsLegendOrientConfig,
263+
echartsLegendAlignConfig: EchartsLegendAlignConfig,
255264
echartsConfig: EchartsOptionComp,
256265
// style: styleControl(EchartsStyle, 'style'),
266+
267+
left:withDefault(NumberControl,trans('heatmapChart.defaultLeft')),
268+
right:withDefault(NumberControl,trans('heatmapChart.defaultRight')),
269+
top:withDefault(NumberControl,trans('heatmapChart.defaultTop')),
270+
bottom:withDefault(NumberControl,trans('heatmapChart.defaultBottom')),
271+
min:withDefault(NumberControl,trans('heatmapChart.defaultMin')),
272+
max:withDefault(NumberControl,trans('heatmapChart.defaultMax')),
273+
257274
tooltip: withDefault(BoolControl, true),
258-
legendVisibility: withDefault(BoolControl, true),
275+
xAxisVisibility: withDefault(BoolControl, true),
276+
yAxisVisibility: withDefault(BoolControl, true),
277+
labelVisibility: withDefault(BoolControl, true),
259278
}
260-
if (EchartsStyle) {
279+
if (EchartDefaultChartStyle && EchartDefaultTextStyle) {
261280
chartJsonModeChildren = {
262281
...chartJsonModeChildren,
263-
style: styleControl(EchartsStyle, 'style'),
282+
chartStyle: styleControl(EchartDefaultChartStyle, 'chartStyle'),
283+
titleStyle: styleControl(EchartDefaultTextStyle, 'titleStyle'),
284+
labelStyle: styleControl(EchartDefaultTextStyle, 'labelStyle'),
285+
xAxisStyle: styleControl(EchartDefaultTextStyle, 'xAxisStyle'),
286+
yAxisStyle: styleControl(EchartDefaultTextStyle, 'yAxisStyle'),
287+
visualMapStyle: styleControl(EchartDefaultTextStyle, 'visualMapStyle'),
264288
}
265289
}
266290

client/packages/lowcoder-comps/src/comps/heatmapChartComp/heatmapChartPropertyView.tsx

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,44 @@ export function heatmapChartPropertyView(
3131
</div>
3232
),
3333
})}
34-
{children.echartsTitle.propertyView({ label: trans("heatmapChart.title") })}
35-
{children.tooltip.propertyView({label: trans("heatmapChart.tooltip")})}
34+
{children.echartsTitleConfig.getPropertyView()}
35+
{children.echartsTitleVerticalConfig.getPropertyView()}
36+
{children.echartsLegendAlignConfig.getPropertyView()}
37+
{children.echartsLegendConfig.getPropertyView()}
38+
{children.echartsLegendOrientConfig.getPropertyView()}
39+
{children.echartsTitle.propertyView({ label: trans("heatmapChart.title"), tooltip: trans("echarts.titleTooltip") })}
40+
{children.left.propertyView({ label: trans("heatmapChart.left"), tooltip: trans("echarts.leftTooltip") })}
41+
{children.right.propertyView({ label: trans("heatmapChart.right"), tooltip: trans("echarts.rightTooltip") })}
42+
{children.top.propertyView({ label: trans("heatmapChart.top"), tooltip: trans("echarts.topTooltip") })}
43+
{children.bottom.propertyView({ label: trans("heatmapChart.bottom"), tooltip: trans("echarts.bottomTooltip") })}
44+
{children.min.propertyView({ label: trans("heatmapChart.min"), tooltip: trans("echarts.minTooltip") })}
45+
{children.max.propertyView({ label: trans("heatmapChart.max"), tooltip: trans("echarts.maxTooltip") })}
46+
47+
{children.xAxisVisibility.propertyView({label: trans("heatmapChart.xAxisVisibility"), tooltip: trans("heatmapChart.xAxisVisibilityTooltip")})}
48+
{children.yAxisVisibility.propertyView({label: trans("heatmapChart.yAxisVisibility"), tooltip: trans("heatmapChart.yAxisVisibilityTooltip")})}
49+
{children.labelVisibility.propertyView({label: trans("heatmapChart.labelVisibility"), tooltip: trans("echarts.labelVisibilityTooltip")})}
50+
{children.tooltip.propertyView({label: trans("heatmapChart.tooltip"), tooltip: trans("echarts.tooltipTooltip")})}
3651
</Section>
3752
<Section name={sectionNames.interaction}>
3853
{children.onEvent.propertyView()}
3954
</Section>
40-
<Section name={sectionNames.style}>
41-
{children.style?.getPropertyView()}
55+
<Section name={sectionNames.chartStyle}>
56+
{children.chartStyle?.getPropertyView()}
57+
</Section>
58+
<Section name={sectionNames.titleStyle}>
59+
{children.titleStyle?.getPropertyView()}
60+
</Section>
61+
<Section name={sectionNames.labelStyle}>
62+
{children.labelStyle?.getPropertyView()}
63+
</Section>
64+
<Section name={sectionNames.xAxisStyle}>
65+
{children.xAxisStyle?.getPropertyView()}
66+
</Section>
67+
<Section name={sectionNames.yAxisStyle}>
68+
{children.yAxisStyle?.getPropertyView()}
69+
</Section>
70+
<Section name={sectionNames.visualMapStyle}>
71+
{children.visualMapStyle?.getPropertyView()}
4272
</Section>
4373
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
4474
</>

0 commit comments

Comments
 (0)