Skip to content

Commit a60dad0

Browse files
committed
end label
1 parent 38bdda7 commit a60dad0

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

‎client/packages/lowcoder-comps/src/comps/basicChartComp/chartConfigs/lineChartConfig.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export const LineChartConfig = (function () {
3232
return new MultiCompBuilder(
3333
{
3434
showLabel: BoolControl,
35+
showEndLabel: BoolControl,
3536
stacked: BoolControl,
3637
area: BoolControl,
3738
smooth: BoolControl,
@@ -71,6 +72,13 @@ export const LineChartConfig = (function () {
7172
if (props.smooth) {
7273
config.smooth = true;
7374
}
75+
if (props.showEndLabel) {
76+
config.endLabel = {
77+
show: true,
78+
formatter: '{a}',
79+
distance: 20
80+
}
81+
}
7482
return config;
7583
}
7684
)
@@ -83,6 +91,9 @@ export const LineChartConfig = (function () {
8391
label: trans("lineChart.area"),
8492
})}
8593
{showLabelPropertyView(children)}
94+
{children.showEndLabel.propertyView({
95+
label: trans("lineChart.showEndLabel"),
96+
})}
8697
{children.smooth.propertyView({ label: trans("chart.smooth") })}
8798
{children.itemColor.getPropertyView()}
8899
</>

‎client/packages/lowcoder-comps/src/comps/lineChartComp/lineChartUtils.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,11 @@ export function getEchartsConfig(
203203
...gridPos,
204204
containLabel: true,
205205
},
206-
visualMap: {
206+
};
207+
if (props.areaPieces.length > 0) {
208+
config.visualMap = {
207209
type: 'piecewise',
208-
show: props.areaPieces.length > 0,
210+
show: false,
209211
dimension: 0,
210212
seriesIndex: 0,
211213
pieces: props.areaPieces?.filter(p => p.getView().from && p.getView().to && p.getView().color)?.map(p => (
@@ -215,8 +217,8 @@ export function getEchartsConfig(
215217
...(p.getView().color?{color: p.getView().color}:{}),
216218
}
217219
))
218-
},
219-
};
220+
}
221+
}
220222
console.log("config", config)
221223
if(props.chartConfig.race) {
222224
config = {

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

+1
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ export const en = {
328328
color: "Color",
329329
areaPieces: "Area Pieces",
330330
areaPiece: "Area Piece",
331+
showEndLabel: "End Label",
331332
},
332333
barChart: {
333334
title: 'Title',

0 commit comments

Comments
 (0)