Liferay.Loader.define("data-engine-js-components-web@1.0.55/js/custom/form-report/components/chart/pie/PieChart",["module","exports","require","liferay!frontend-js-react-web$react","frontend-js-recharts$recharts","../../../utils/colors","../../../utils/data","../Legend","../TooltipContent"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({data:t,height:n,totalEntries:c,width:d}){const[s,f]=(0,a.useState)(null),[p,h]=(0,a.useState)(!0),m=()=>{f(null)},y=e=>{f(e)};return a.default.createElement("div",{className:"custom-chart-size pie-chart"},a.default.createElement(r.ResponsiveContainer,{height:n||"99%",width:d||"50%"},a.default.createElement(r.PieChart,null,a.default.createElement(r.Pie,{activeIndex:s,activeShape:({cx:e,cy:t,endAngle:n,innerRadius:o,outerRadius:i,startAngle:u})=>(h(!1),a.default.createElement("g",null,a.default.createElement(r.Sector,{cx:e,cy:t,endAngle:n,fill:(0,l.default)(s),innerRadius:o,onMouseOut:m,outerRadius:i+5,startAngle:u}))),cx:"50%",cy:"50%",data:t,dataKey:"count",endAngle:-270,innerRadius:80,isAnimationActive:p,label:({cx:t,cy:n,innerRadius:r,midAngle:l,outerRadius:i,percent:u})=>{const c=r+.5*(i-r),d=t+c*Math.cos(-l*e),s=n+c*Math.sin(-l*e);return a.default.createElement("text",{dominantBaseline:"central",fill:"white",textAnchor:"middle",x:d,y:s},(0,o.roundPercentage)(u))},labelLine:!1,nameKey:"label",onMouseOver:(e,t)=>y(t),outerRadius:135,paddingAngle:0,startAngle:90},t.map(((e,t)=>a.default.createElement(r.Cell,{fill:(0,l.default)(t),fillOpacity:null!==s&&s!==t?.5:1,key:t})))),a.default.createElement(r.Tooltip,{content:a.default.createElement(u.default,{showBullet:!0,showHeader:!1,totalEntries:c})}))),a.default.createElement(i.default,{activeIndex:s,labels:t.map((({label:e})=>e)),onMouseOut:m,onMouseOver:y}))};var a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=d();if(t&&t.has(e))return t.get(e);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var l=a?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(n,r,l):n[r]=e[r]}n.default=e,t&&t.set(e,n);return n}(n("liferay!frontend-js-react-web$react")),r=n("frontend-js-recharts$recharts"),l=c(n("../../../utils/colors")),o=n("../../../utils/data"),i=c(n("../Legend")),u=c(n("../TooltipContent"));function c(e){return e&&e.__esModule?e:{default:e}}function d(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return d=function(){return e},e}const e=Math.PI/180}}));
//# sourceMappingURL=PieChart.js.map