@@ -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+
327331const 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