Skip to content

Commit 514182c

Browse files
committed
Fix - VueUiSparkstackbar - Fix regression
1 parent d447282 commit 514182c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/components/vue-ui-sparkstackbar.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ const absoluteDataset = computed(() => {
180180
...d,
181181
value: dValue,
182182
proportion: dProportion,
183-
width: dWidth || svg.value.width / safeDatasetCopy.value.length,
183+
width: dWidth,
184184
proportionLabel: dataLabel({
185185
v: dProportion * 100,
186186
s: '%',
@@ -258,7 +258,7 @@ function selectDatapoint(datapoint, index) {
258258
/>
259259
</clipPath>
260260
</defs>
261-
<g clip-path="url(#stackPill)">
261+
<g clip-path="url(#stackPill)" v-if="total > 0">
262262
<rect
263263
:x="0"
264264
:y="0"
@@ -280,6 +280,16 @@ function selectDatapoint(datapoint, index) {
280280
:class="{'animated': !isLoading}"
281281
/>
282282
</g>
283+
<rect v-else
284+
:x="2"
285+
:y="1"
286+
:width="svg.width - 4"
287+
:height="svg.height - 2"
288+
stroke="#CCCCCC"
289+
stroke-width="2"
290+
fill="transparent"
291+
:rx="(svg.height - 4) / 2"
292+
/>
283293
</svg>
284294

285295
<Skeleton

0 commit comments

Comments
 (0)