Liferay.Loader.define("data-engine-js-components-web@1.0.107/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:u},tick:{fontSize:14},tickLine:!1,type:"number"}),a.default.createElement(l.YAxis,{dataKey:"label",stroke:c,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:s,onMouseOut:()=>{p(null)},onMouseOver:(e,t)=>(e=>{p(e)})(t),tabIndex:0},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:e,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{black:e,blueDark:c,gray:u,lightBlue:s}=n.NAMED_COLORS}}));
//# sourceMappingURL=SimpleBarChart.js.map