@@ -518,6 +518,26 @@ const currentDonut = computed(() => {
518518 return d
519519});
520520
521+ const hasData = computed (() => {
522+ return Math .abs (donutSet .value .map (d => d .value ).reduce ((a , b ) => a + b, 0 )) > 0 ;
523+ })
524+
525+ const emptySkeleton = computed (() => {
526+ return makeDonut ({
527+ series: [
528+ {
529+ value: 1 ,
530+ color: FINAL_CONFIG .value .style .chart .layout .donut .emptyFill ,
531+ name: ' _' ,
532+ seriesIndex: 0 ,
533+ patternIndex: - 1 ,
534+ ghost: false ,
535+ absoluteValues: [1 ]
536+ },
537+ ],
538+ }, svg .value .width / 2 , svg .value .height / 2 , minSize .value , minSize .value , 1.99999 , 2 , 1 , 360 , 105.25 , donutThickness .value )
539+ });
540+
521541const noGhostDonut = computed (() => currentDonut .value .filter (el => ! el .ghost ))
522542
523543const polarAreas = computed (() => {
@@ -973,12 +993,18 @@ defineExpose({
973993 <template v-if =" total && FINAL_CONFIG .type === ' classic' " >
974994 <path v-for =" (arc, i) in noGhostDonut" :stroke =" FINAL_CONFIG.style.chart.backgroundColor"
975995 :d =" arc.arcSlice" fill =" #FFFFFF" />
976- <path v-for =" (arc, i) in noGhostDonut" class =" vue-ui-donut-arc-path" :data-cy =" `donut-arc-${i}`"
977- :d =" arc.arcSlice" :fill =" arc.color"
978- :stroke =" FINAL_CONFIG.style.chart.backgroundColor"
979- :stroke-width =" FINAL_CONFIG.style.chart.layout.donut.borderWidth" :filter =" getBlurFilter(i)"
980-
981- />
996+
997+ <path
998+ v-for =" (arc, i) in noGhostDonut"
999+ class =" vue-ui-donut-arc-path"
1000+ :data-cy =" `donut-arc-${i}`"
1001+ :d =" arc.arcSlice"
1002+ :fill =" arc.color"
1003+ :stroke =" FINAL_CONFIG.style.chart.backgroundColor"
1004+ :stroke-width =" FINAL_CONFIG.style.chart.layout.donut.borderWidth"
1005+ :filter =" getBlurFilter(i)"
1006+ />
1007+
9821008 <g v-if =" $slots.pattern" >
9831009 <path v-for =" (arc, i) in noGhostDonut" class =" vue-ui-donut-arc-path"
9841010 :data-cy =" `donut-arc-pattern-${arc.patternIndex}`" :d =" arc.arcSlice"
@@ -1043,6 +1069,18 @@ defineExpose({
10431069 </template >
10441070
10451071 <template v-else >
1072+ <!-- EMPTY SKELETON -->
1073+ <g v-if =" FINAL_CONFIG.type === 'classic' && !hasData" >
1074+ <path
1075+ v-for =" (arc, i) in emptySkeleton"
1076+ class =" vue-ui-donut-arc-path"
1077+ :data-cy =" `empty-skeleton-${i}`"
1078+ :d =" arc.arcSlice"
1079+ :fill =" arc.color"
1080+ :stroke =" FINAL_CONFIG.style.chart.backgroundColor"
1081+ :stroke-width =" FINAL_CONFIG.style.chart.layout.donut.borderWidth"
1082+ />
1083+ </g >
10461084 <circle :cx =" svg.width / 2" :cy =" svg.height / 2" :r =" minSize <= 0 ? 10 : minSize" fill =" transparent"
10471085 :stroke =" FINAL_CONFIG.style.chart.backgroundColor" />
10481086 </template >
0 commit comments