Skip to content

Commit 02df222

Browse files
committed
Fix - VueUiXy - Place datapoint label correctly when value is 0
1 parent b2c3113 commit 02df222

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/vue-ui-xy.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@
675675
:data-cy="`xy-bar-label-x-${i}-${j}`"
676676
v-if="plot && (!Object.hasOwn(serie, 'dataLabels') || serie.dataLabels === true) && FINAL_CONFIG.bar.labels.show"
677677
:x="mutableConfig.useIndividualScale && mutableConfig.isStacked ? plot.x + slot.line / 2 : calcRectX(plot) + calcRectWidth() / 2 - barPeriodGap / 2"
678-
:y="checkNaN(plot.y) + (plot.value > 0 ? FINAL_CONFIG.bar.labels.offsetY : - FINAL_CONFIG.bar.labels.offsetY * 3)"
678+
:y="checkNaN(plot.y) + (plot.value >= 0 ? FINAL_CONFIG.bar.labels.offsetY : - FINAL_CONFIG.bar.labels.offsetY * 3)"
679679
text-anchor="middle"
680680
:font-size="fontSizes.plotLabels"
681681
:fill="FINAL_CONFIG.bar.labels.color"
@@ -778,7 +778,7 @@
778778
:data-cy="`xy-line-label-x-${i}-${j}`"
779779
v-if="plot && !Object.hasOwn(serie, 'dataLabels') || serie.dataLabels === true"
780780
:x="plot.x"
781-
:y="plot.y + (plot.value > 0 ? FINAL_CONFIG.line.labels.offsetY : - FINAL_CONFIG.line.labels.offsetY * 3)"
781+
:y="plot.y + (plot.value >= 0 ? FINAL_CONFIG.line.labels.offsetY : - FINAL_CONFIG.line.labels.offsetY * 3)"
782782
text-anchor="middle"
783783
:font-size="fontSizes.plotLabels"
784784
:fill="FINAL_CONFIG.line.labels.color"

0 commit comments

Comments
 (0)