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