|
1193 | 1193 | <g v-if="annotationsY.length && !mutableConfig.isStacked">
|
1194 | 1194 | <g v-for="annotation in annotationsY" :key="annotation.uid">
|
1195 | 1195 | <line
|
1196 |
| - v-if="annotation.yTop" |
| 1196 | + v-if="annotation.yTop && annotation.show" |
1197 | 1197 | :x1="annotation.x1"
|
1198 | 1198 | :y1="annotation.yTop"
|
1199 | 1199 | :x2="annotation.x2"
|
|
1205 | 1205 | :style="{ animation: 'none !important'}"
|
1206 | 1206 | />
|
1207 | 1207 | <line
|
1208 |
| - v-if="annotation.yBottom" |
| 1208 | + v-if="annotation.yBottom && annotation.show" |
1209 | 1209 | :x1="annotation.x1"
|
1210 | 1210 | :y1="annotation.yBottom"
|
1211 | 1211 | :x2="annotation.x2"
|
|
1217 | 1217 | :style="{ animation: 'none !important'}"
|
1218 | 1218 | />
|
1219 | 1219 | <rect
|
1220 |
| - v-if="annotation.hasArea" |
| 1220 | + v-if="annotation.hasArea && annotation.show" |
1221 | 1221 | :y="Math.min(annotation.yTop, annotation.yBottom)"
|
1222 | 1222 | :x="annotation.x1"
|
1223 | 1223 | :width="drawingArea.width"
|
1224 |
| - :height="annotation.areaHeight" |
| 1224 | + :height="checkNaN(annotation.areaHeight, 0)" |
1225 | 1225 | :fill="setOpacity(annotation.config.area.fill, annotation.config.area.opacity)"
|
1226 | 1226 | :style="{ animation: 'none !important' }"
|
1227 | 1227 | />
|
1228 | 1228 | <rect
|
1229 |
| - v-if="annotation.config.label.text" |
| 1229 | + v-if="annotation.config.label.text && annotation.show" |
1230 | 1230 | class="vue-ui-xy-annotation-label-box"
|
1231 | 1231 | v-bind="annotation._box"
|
1232 | 1232 | :style="{ animation: 'none !important', transition: 'none !important'}"
|
1233 | 1233 | />
|
1234 | 1234 | <text
|
| 1235 | + v-if="annotation.config.label.text && annotation.show" |
1235 | 1236 | :id="annotation.id"
|
1236 | 1237 | class="vue-ui-xy-annotation-label"
|
1237 |
| - v-if="annotation.config.label.text" |
1238 | 1238 | :x="annotation._text.x"
|
1239 | 1239 | :y="annotation._text.y"
|
1240 | 1240 | :font-size="annotation.config.label.fontSize"
|
@@ -2404,7 +2404,7 @@ export default {
|
2404 | 2404 | this.scaleGroups[datapoint.scaleLabel].unique = this.activeSeriesWithStackRatios.filter(el => el.scaleLabel === datapoint.scaleLabel).length === 1
|
2405 | 2405 |
|
2406 | 2406 | const areaZeroPosition = this.mutableConfig.useIndividualScale ? datapoint.autoScaling ? autoScaleZeroPosition : zeroPosition : this.zero;
|
2407 |
| - const adustedAreaZeroPosition = Math.max(Math.max(datapoint.autoScaling ? autoScaleZeroPosition : scaleYLabels.at(-1).y, this.drawingArea.top), areaZeroPosition); |
| 2407 | + const adustedAreaZeroPosition = Math.max(Math.max(datapoint.autoScaling ? autoScaleZeroPosition : scaleYLabels.at(-1).y || 0, this.drawingArea.top), areaZeroPosition); |
2408 | 2408 |
|
2409 | 2409 | return {
|
2410 | 2410 | ...datapoint,
|
@@ -2932,8 +2932,10 @@ export default {
|
2932 | 2932 | }
|
2933 | 2933 |
|
2934 | 2934 | const rectY = yText - (textHeight * 0.75) - label.padding.top;
|
| 2935 | + const show = ![yTop, yBottom, rectY].includes(NaN); |
2935 | 2936 |
|
2936 | 2937 | return {
|
| 2938 | + show, |
2937 | 2939 | id: `annotation_y_${this.createUid()}`,
|
2938 | 2940 | hasArea,
|
2939 | 2941 | areaHeight: hasArea ? Math.abs(yTop - yBottom) : 0,
|
|
0 commit comments