Skip to content

Commit 0f4ddd2

Browse files
committed
Fix - VueUiXy - Fix some harmless svg console errors in some cases when dataset is empty
1 parent c347a34 commit 0f4ddd2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/components/vue-ui-xy.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,7 @@
12171217
<g v-if="annotationsY.length && !mutableConfig.isStacked">
12181218
<g v-for="annotation in annotationsY" :key="annotation.uid">
12191219
<line
1220-
v-if="annotation.yTop && annotation.show"
1220+
v-if="annotation.yTop && annotation.show && isFinite(annotation.yTop)"
12211221
:x1="annotation.x1"
12221222
:y1="annotation.yTop"
12231223
:x2="annotation.x2"
@@ -1229,7 +1229,7 @@
12291229
:style="{ animation: 'none !important'}"
12301230
/>
12311231
<line
1232-
v-if="annotation.yBottom && annotation.show"
1232+
v-if="annotation.yBottom && annotation.show && isFinite(annotation.yBottom)"
12331233
:x1="annotation.x1"
12341234
:y1="annotation.yBottom"
12351235
:x2="annotation.x2"
@@ -1241,7 +1241,7 @@
12411241
:style="{ animation: 'none !important'}"
12421242
/>
12431243
<rect
1244-
v-if="annotation.hasArea && annotation.show"
1244+
v-if="annotation.hasArea && annotation.show && isFinite(annotation.yTop) && isFinite(annotation.yBottom)"
12451245
:y="Math.min(annotation.yTop, annotation.yBottom)"
12461246
:x="annotation.x1"
12471247
:width="drawingArea.width"
@@ -1250,13 +1250,13 @@
12501250
:style="{ animation: 'none !important' }"
12511251
/>
12521252
<rect
1253-
v-if="annotation.config.label.text && annotation.show"
1253+
v-if="annotation.config.label.text && annotation.show && isFinite(annotation._box.y)"
12541254
class="vue-ui-xy-annotation-label-box"
12551255
v-bind="annotation._box"
12561256
:style="{ animation: 'none !important', transition: 'none !important'}"
12571257
/>
12581258
<text
1259-
v-if="annotation.config.label.text && annotation.show"
1259+
v-if="annotation.config.label.text && annotation.show && isFinite(annotation._text.y)"
12601260
:id="annotation.id"
12611261
class="vue-ui-xy-annotation-label"
12621262
:x="annotation._text.x"
@@ -3547,7 +3547,7 @@ export default {
35473547
},
35483548
calcRectY(plot) {
35493549
if(plot.value >= 0) return plot.y;
3550-
return this.zero;
3550+
return [null, undefined, NaN, Infinity, -Infinity].includes(this.zero) ? this.drawingArea.bottom : this.zero;
35513551
},
35523552
calcIndividualRectY(plot) {
35533553
if(plot.value >= 0) return plot.y;

0 commit comments

Comments
 (0)