Liferay.Loader.define("data-engine-js-components-web@1.0.79/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:"lfr-de-recharts pie-chart",style:{display:"flex",height:"100%",width:"100%"}},a.default.createElement(r.ResponsiveContainer,{height:n||"100%",width:d||"70%"},a.default.createElement(r.PieChart,null,a.default.createElement(r.Pie,{activeIndex:s,activeShape:({cx:e,cy:t,endAngle:n,innerRadius:i,outerRadius:o,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:i,onMouseOut:m,outerRadius:o+5,startAngle:u}))),cx:"50%",cy:"50%",data:t,dataKey:"count",endAngle:-270,innerRadius:"60%",isAnimationActive:p,label:({cx:t,cy:n,innerRadius:r,midAngle:l,outerRadius:o,percent:u})=>{const c=r+.5*(o-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,i.roundPercentage)(u))},labelLine:!1,nameKey:"label",onMouseOver:(e,t)=>y(t),outerRadius:"100%",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(o.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")),i=n("../../../utils/data"),o=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