Skip to content

Commit 1043d1c

Browse files
committed
Fix - VueUiQuickChart - Fix marker links too short in donut mode
1 parent aeeabe0 commit 1043d1c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/components/vue-ui-quick-chart.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,10 @@ function setCommonSelectedIndex(index) {
324324
commonSelectedIndex.value = index;
325325
}
326326
327+
const optimalDonutThickness = computed(() => {
328+
return FINAL_CONFIG.value.donutThicknessRatio < 0.15 ? 0.15 : FINAL_CONFIG.value.donutThicknessRatio > 0.4 ? 0.4 : FINAL_CONFIG.value.donutThicknessRatio;
329+
})
330+
327331
const donut = computed(() => {
328332
if(chartType.value !== detector.chartType.DONUT) return null;
329333
const ds = formattedDataset.value.dataset.map((ds, i) => {
@@ -453,7 +457,7 @@ const donut = computed(() => {
453457
1,
454458
360,
455459
105.25,
456-
(defaultSizes.value.height) * FINAL_CONFIG.value.donutThicknessRatio
460+
(defaultSizes.value.height) * optimalDonutThickness.value
457461
)
458462
}
459463
});
@@ -943,7 +947,7 @@ defineExpose({
943947
<template v-for="(arc, i) in donut.chart">
944948
<path
945949
v-if="donut.isArcBigEnough(arc)"
946-
:d="calcNutArrowPath(arc, {x: (FINAL_CONFIG.width || defaultSizes.width) / 2, y: (FINAL_CONFIG.height || defaultSizes.height) /2}, 16, 16, false, false, FINAL_CONFIG.donutLabelMarkerStrokeWidth)"
950+
:d="calcNutArrowPath(arc, {x: defaultSizes.width / 2, y: defaultSizes.height / 2}, 16, 16, false, false, (defaultSizes.height * optimalDonutThickness))"
947951
:stroke="arc.color"
948952
:stroke-width="FINAL_CONFIG.donutLabelMarkerStrokeWidth"
949953
stroke-linecap="round"
@@ -953,6 +957,7 @@ defineExpose({
953957
/>
954958
</template>
955959
</g>
960+
956961
<circle
957962
class="donut-hollow"
958963
:cx="(FINAL_CONFIG.width || defaultSizes.width) / 2"

0 commit comments

Comments
 (0)