Skip to content

Commit 5fb1fc0

Browse files
committed
Added Tooltip to CandleStick chart.
1 parent c75bbe7 commit 5fb1fc0

File tree

6 files changed

+34
-19
lines changed

6 files changed

+34
-19
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
uiChildren,
1717
clickEvent,
1818
styleControl,
19-
EchartDefaultChartStyle,
19+
EchartCandleStickChartStyle,
2020
EchartDefaultTextStyle
2121
} from "lowcoder-sdk";
2222
import { RecordConstructorToComp, RecordConstructorToView } from "lowcoder-core";
@@ -264,12 +264,12 @@ let chartJsonModeChildren: any = {
264264
dataZoomHeight:withDefault(NumberControl,trans('candleStickChart.defaultDataZoomHeight')),
265265
tooltip: withDefault(BoolControl, true),
266266
dataZoomVisibility: withDefault(BoolControl, true),
267-
axisFlag: withDefault(BoolControl, true),
267+
axisFlagVisibility: withDefault(BoolControl, true),
268268
}
269-
if (EchartDefaultChartStyle && EchartDefaultTextStyle) {
269+
if (EchartCandleStickChartStyle && EchartDefaultTextStyle) {
270270
chartJsonModeChildren = {
271271
...chartJsonModeChildren,
272-
chartStyle: styleControl(EchartDefaultChartStyle, 'chartStyle'),
272+
chartStyle: styleControl(EchartCandleStickChartStyle, 'chartStyle'),
273273
titleStyle: styleControl(EchartDefaultTextStyle, 'titleStyle'),
274274
labelStyle: styleControl(EchartDefaultTextStyle, 'labelStyle'),
275275
legendStyle: styleControl(EchartDefaultTextStyle, 'legendStyle'),

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ export function candleStickChartPropertyView(
3333
})}
3434
{children.echartsTitleConfig.getPropertyView()}
3535
{children.echartsTitleVerticalConfig.getPropertyView()}
36-
{children.left.propertyView({ label: trans("candleStickChart.left") })}
37-
{children.right.propertyView({ label: trans("candleStickChart.right") })}
38-
{children.top.propertyView({ label: trans("candleStickChart.top") })}
39-
{children.bottom.propertyView({ label: trans("candleStickChart.bottom") })}
40-
{children.echartsTitle.propertyView({ label: trans("candleStickChart.title") })}
41-
{children.dataZoomVisibility.getView() && children.dataZoomHeight.propertyView({ label: trans("candleStickChart.dataZoomHeight") })}
42-
{children.dataZoomVisibility.getView() && children.dataZoomBottom.propertyView({ label: trans("candleStickChart.dataZoomBottom") })}
43-
{children.axisFlag.propertyView({label: trans("candleStickChart.axisFlag")})}
44-
{children.dataZoomVisibility.propertyView({label: trans("candleStickChart.dataZoomVisibility")})}
36+
{children.echartsTitle.propertyView({ label: trans("candleStickChart.title"), tooltip: trans("echarts.titleTooltip") })}
37+
{children.left.propertyView({ label: trans("candleStickChart.left"), tooltip: trans("echarts.leftTooltip") })}
38+
{children.right.propertyView({ label: trans("candleStickChart.right"), tooltip: trans("echarts.rightTooltip") })}
39+
{children.top.propertyView({ label: trans("candleStickChart.top"), tooltip: trans("echarts.topTooltip") })}
40+
{children.bottom.propertyView({ label: trans("candleStickChart.bottom"), tooltip: trans("echarts.bottomTooltip") })}
41+
{children.dataZoomVisibility.getView() && children.dataZoomHeight.propertyView({ label: trans("candleStickChart.dataZoomHeight"), tooltip: trans("candleStickChart.dataZoomHeightTooltip") })}
42+
{children.dataZoomVisibility.getView() && children.dataZoomBottom.propertyView({ label: trans("candleStickChart.dataZoomBottom"), tooltip: trans("candleStickChart.dataZoomBottomTooltip") })}
43+
{children.axisFlagVisibility.propertyView({label: trans("candleStickChart.axisFlagVisibility"), tooltip: trans("candleStickChart.axisFlagVisibilityTooltip") })}
44+
{children.dataZoomVisibility.propertyView({label: trans("candleStickChart.dataZoomVisibility"), tooltip: trans("candleStickChart.dataZoomVisibilityTooltip") })}
4545
</Section>
4646
<Section name={sectionNames.interaction}>
4747
{children.onEvent.propertyView()}

client/packages/lowcoder-comps/src/comps/candleStickChartComp/candleStickChartUtils.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export function getEchartsConfig(
172172
yAxis: {
173173
type: "value",
174174
scale: true,
175-
splitArea: props?.axisFlag && {
175+
splitArea: props?.axisFlagVisibility && {
176176
show: true,
177177
areaStyle: {
178178
color: props?.echartsOption?.axisColor
@@ -185,7 +185,7 @@ export function getEchartsConfig(
185185
xAxis: props?.echartsOption && {
186186
type: 'category',
187187
data: props?.echartsOption.xAxis.data,
188-
splitArea: !props?.axisFlag && {
188+
splitArea: !props?.axisFlagVisibility && {
189189
show: true,
190190
areaStyle: {
191191
// Provide multiple colors to alternate through
@@ -213,7 +213,6 @@ export function getEchartsConfig(
213213
data: props?.echartsOption.data,
214214
itemStyle: {
215215
...props?.echartsOption.itemStyle,
216-
borderColor: props?.chartStyle?.chartBorderColor || theme?.chartStyle?.borderColor,
217216
borderWidth: props?.chartStyle?.chartBorderWidth || theme?.chartStyle?.borderWidth,
218217
borderType: props?.chartStyle?.chartBorderStyle || theme?.chartStyle?.borderType,
219218
borderRadius: Number(props?.chartStyle?.chartBorderRadius || theme?.chartStyle?.borderRadius),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export function getEchartsConfig(
195195
"borderColor": props?.chartStyle?.chartBorderColor || theme?.chartStyle?.borderColor,
196196
"borderWidth": props?.chartStyle?.chartBorderWidth || theme?.chartStyle?.borderWidth,
197197
"borderType": props?.chartStyle?.chartBorderStyle || theme?.chartStyle?.borderType,
198-
"borderRadius": props?.chartStyle?.chartBorderRadius || theme?.chartStyle?.borderRadius,
198+
"borderRadius": Number(props?.chartStyle?.chartBorderRadius || theme?.chartStyle?.borderRadius),
199199
"shadowColor": props?.chartStyle?.chartShadowColor || theme?.chartStyle?.shadowColor,
200200
"shadowBlur": props?.chartStyle?.chartBoxShadow?.split('px')[0] || theme?.chartStyle?.boxShadow?.split('px')[0],
201201
"shadowOffsetX": props?.chartStyle?.chartBoxShadow?.split('px')[1] || theme?.chartStyle?.boxShadow?.split('px')[1],

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const en = {
5454
tooltip: 'Tooltip',
5555
legendVisibility: 'Legend Visibility',
5656
dataZoomVisibility: 'Data Zoom Visibility',
57-
axisFlag: 'Axis Flag',
57+
axisFlagVisibility: 'Axis Flag',
5858
left: 'Left',
5959
defaultLeft:'10',
6060
right: 'Right',
@@ -66,7 +66,12 @@ export const en = {
6666
defaultDataZoomBottom: '20',
6767
dataZoomBottom: 'Data Zoom Bottom',
6868
defaultDataZoomHeight: '15',
69-
dataZoomHeight: 'Data Zoom Height'
69+
dataZoomHeight: 'Data Zoom Height',
70+
axisFlagVisibilityTooltip: "Divide the area Vertically/horizontally.",
71+
dataZoomVisibilityTooltip: "Show or hide the DataZoom of the Chart.",
72+
dataZoomHeightTooltip: "Select the Height length of DataZoom.",
73+
dataZoomBottomTooltip: "Select the Bottom length of DataZoom."
74+
7075
},
7176
sankeyChart: {
7277
sankeyType: 'Sankey Chart Type',
@@ -196,6 +201,8 @@ export const en = {
196201
positionChart_x_Tooltip: "Change the Horizontal position of the Chart.",
197202
positionChart_y_Tooltip: "Change the Vertical position of the Chart.",
198203
topTooltip: "Change the top length of the Chart.",
204+
rightTooltip: "Change the right length of the Chart.",
205+
leftTooltip: "Change the left length of the Chart.",
199206
bottomTooltip: "Change the bottom length of the Chart.",
200207
widthTooltip: "Change the width of the Chart.",
201208
radiusTooltip: "Set the Radius value of the Chart.",

client/packages/lowcoder/src/comps/controls/styleControlConstants.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,6 +2004,15 @@ export const EchartDefaultChartStyle = [
20042004
CHARTBORDERWIDTH,
20052005
] as const;
20062006

2007+
export const EchartCandleStickChartStyle = [
2008+
getBackground("primarySurface"),
2009+
CHARTSHADOWCOLOR,
2010+
CHARTBOXSHADOW,
2011+
CHARTBORDERSTYLE,
2012+
CHARTBORDERRADIUS,
2013+
CHARTBORDERWIDTH,
2014+
] as const;
2015+
20072016
export const EchartDefaultDetailStyle = [
20082017
CHARTBACKGROUNDCOLOR,
20092018
DETAILSIZE,

0 commit comments

Comments
 (0)