@pablo-amberflo/ui-kit-test-pablo
Version:
Amberflo UI Kit
2 lines (1 loc) • 2.25 kB
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("chart.js"),o=require("react-chartjs-2"),t=require("@mui/material"),a=require("./styled-19d0c372.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("@emotion/styled"),require("@emotion/react");var c=l(e),n={responsive:!0,indexAxis:"y",plugins:{title:{display:!0,text:"Usage by dimensions",position:"top",fullSize:!0,font:{size:16},padding:{bottom:50}},legend:{position:"bottom",labels:{boxWidth:7,usePointStyle:!0,pointStyle:"circle",color:"#212121",padding:20,font:{size:14}}}},scales:{y:{beginAtZero:!0,grid:{color:"#cccccc",borderDash:[4,4]},stacked:!0,ticks:{color:"#212121",font:{size:14},callback:function(e){var r,o,t,a="number"==typeof e?e:parseFloat(e);return 0!==Math.floor(a)?"$".concat((o=(r=a).toString().split(".")[1],t=o&&o.length>2?o.length:2,parseFloat(r.toString()).toFixed(t))):a.toString()}}},x:{stacked:!0,grid:{color:"transparent"},ticks:{color:"black",font:{size:14}}}}},i={labels:["08/01","08/02","08/03"],datasets:[{label:"us-east-1",backgroundColor:"#55BDC5",borderColor:"#55BDC5",hoverBackgroundColor:"#55BDC5",hoverBorderColor:"#55BDC5",barPercentage:.7,categoryPercentage:.3,data:[1200,1500,2e3]},{label:"us-east-2",backgroundColor:"#4D49CB",borderColor:"#4D49CB",hoverBackgroundColor:"#4D49CB",hoverBorderColor:"#4D49CB",barPercentage:.7,categoryPercentage:.3,data:[900,800,1222]},{label:"us-west-1",backgroundColor:"#DC8B39",borderColor:"#DC8B39",hoverBackgroundColor:"#DC8B39",hoverBorderColor:"#DC8B39",barPercentage:.7,categoryPercentage:.3,data:[650,700,890]},{label:"us-west-2",backgroundColor:"#ca03fc",borderColor:"#ca03fc",hoverBackgroundColor:"#ca03fc",hoverBorderColor:"black",barPercentage:.7,categoryPercentage:.3,data:[650,700,890]}]},d=a.styled("div")({padding:"4rem"}),s=a.styled(t.Paper)({padding:"2rem 2rem 1rem 2rem",boxShadow:"rgba(0, 0, 0, 0.24) 0px 3px 8px"});r.Chart.register(r.CategoryScale,r.LinearScale,r.BarElement,r.Title,r.Tooltip,r.Legend);exports.BarGraph=function(e){var r=e.options,t=void 0===r?n:r,a=e.data,l=void 0===a?i:a;return c.default.createElement(d,null,c.default.createElement(s,null,c.default.createElement(o.Bar,{options:t,data:l})))};