import{H as n}from"./DaWAgGwk.js";import{C as a}from"./CnGBFLmb.js";import{u}from"./DEcB3HXe.js";import{d as g,y as d,z as c,B as h,o as p,c as f,f as s,C as m}from"./llFuKhWI.js";const C=g({__name:"PieChart",props:{series:{},seriesTitle:{default:""},xAxisCategories:{},inMillion:{type:Boolean,default:!1},paywallActive:{type:Boolean,default:!1},showLegend:{type:Boolean,default:!1},legendPosition:{default:"bottom"},donut:{type:Boolean,default:!1}},setup(l){const i=d("chartHeightPx",250),e=l,t=u({showLegend:e.showLegend,chartHeightPx:i,roundSmallPercentages:!0});return c(()=>e.series,t.regenerateUuid,{deep:!0}),h(()=>{t.xAxis.value={...t.xAxis.value,min:.25,max:e.xAxisCategories.length-1.25,categories:e.xAxisCategories},t.yAxis.value=[{title:{text:null},labels:{enabled:!1}}],t.series.value=[{type:"pie",name:e.seriesTitle,legendIndex:0,data:e.series}];let o=t.legend.value;e.legendPosition==="right"&&(o={...t.legend.value,layout:"vertical",align:"right",verticalAlign:"middle",itemMarginTop:10,itemMarginBottom:10}),t.legend.value=e.showLegend?o:{enabled:!1},t.plotOptions.value.pie={borderRadius:0,borderWidth:3,...e.donut?{innerSize:"36%"}:{},colors:[a.bluegray_800,a.bluegray_700,a.bluegray_500,a.bluegray_300,a.bluegray_200,a.bluegray_100,a.bluegray_50],showInLegend:e.showLegend}}),(o,x)=>{const r=n;return e.xAxisCategories.length?(p(),f(r,{key:s(t).uuid.value,options:s(t).options.value},null,8,["options"])):m("",!0)}}});export{C as _};