Skip to content

Commit 5dbb089

Browse files
committed
Improvement - VueUiVerticalBar - Add support for negative values
1 parent f9fc06e commit 5dbb089

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/vue-ui-vertical-bar.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,10 @@ function makeDataLabel(value, datapoint, seriesIndex, sign) {
440440
}
441441
const label = applyDataLabel(
442442
FINAL_CONFIG.value.style.chart.layout.bars.dataLabels.value.formatter,
443-
sign === 1 ? value : -value,
443+
sign === -1 ? (value >= 0 ? -value : value) : value,
444444
dataLabel({
445445
p: FINAL_CONFIG.value.style.chart.layout.bars.dataLabels.value.prefix,
446-
v: sign === 1 ? value : -value,
446+
v: sign === -1 ? (value >= 0 ? -value : value) : value,
447447
s: FINAL_CONFIG.value.style.chart.layout.bars.dataLabels.value.suffix,
448448
r: FINAL_CONFIG.value.style.chart.layout.bars.dataLabels.value.roundingValue
449449
}),

0 commit comments

Comments
 (0)