Liferay.Loader.define("data-engine-js-components-web@1.0.87/js/custom/form-report/components/chart/bar/SimpleBarChart",["module","exports","require","liferay!frontend-js-react-web$react","frontend-js-recharts$recharts","../../../utils/colors","../../../utils/ellipsize","../TooltipContent"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function SimpleBarChart({data:t,height:r,totalEntries:n,width:f}){const[d,p]=(0,a.useState)(null);return a.default.createElement("div",{className:"lfr-de-recharts",style:{display:"flex",height:"100%",minHeight:"500px",width:"100%"}},a.default.createElement(l.ResponsiveContainer,{height:r||"100%",width:f||"100%"},a.default.createElement(l.BarChart,{data:t,layout:"vertical",margin:{bottom:20,left:20,right:20,top:20}},a.default.createElement(l.XAxis,{axisLine:{stroke:c},tick:{fontSize:14},tickLine:!1,type:"number"}),a.default.createElement(l.YAxis,{dataKey:"label",stroke:e,tick:({payload:e,x:t,y:r})=>a.default.createElement("g",{transform:"translate(".concat(t,",").concat(r,")")},a.default.createElement("text",{className:"".concat(null!==d&&d!==e.index?"dim":""),x:-162},"".concat(e.value.replace(/\s/g,"").length>24?(0,i.default)(e.value,24):e.value))),tickLine:!1,tickMargin:16,type:"category",width:214}),a.default.createElement(l.Tooltip,{content:a.default.createElement(o.default,{showBullet:!1,showHeader:!1,totalEntries:n}),cursor:{fill:"transparent"}}),a.default.createElement(l.Bar,{barCategoryGap:30,barGap:5,dataKey:"count",fill:u,onMouseOut:()=>{p(null)},onMouseOver:(e,t)=>(e=>{p(e)})(t)},t.map(((e,t)=>a.default.createElement(l.Cell,{fillOpacity:null!=d&&d!==t?".5":1,key:"cell-".concat(t)}))),a.default.createElement(l.LabelList,{dataKey:"count",fill:s,fontSize:14,offset:16,position:"insideRight"})))))};var a=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={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var n=a?Object.getOwnPropertyDescriptor(e,l):null;n&&(n.get||n.set)?Object.defineProperty(r,l,n):r[l]=e[l]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),l=r("frontend-js-recharts$recharts"),n=r("../../../utils/colors"),i=_interopRequireDefault(r("../../../utils/ellipsize")),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{blueDark:e,gray:c,lightBlue:u,white:s}=n.NAMED_COLORS}}));
//# sourceMappingURL=SimpleBarChart.js.map