76 lines
1.6 KiB
JavaScript
76 lines
1.6 KiB
JavaScript
import React, { Component } from "react";
|
|
import Card from "@mui/material/Card";
|
|
import { Typography } from "@mui/material";
|
|
import dynamic from "next/dynamic";
|
|
const Chart = dynamic(() => import("react-apexcharts"), {
|
|
ssr: false,
|
|
});
|
|
|
|
class SimplePieChart extends Component {
|
|
constructor(props) {
|
|
super(props);
|
|
|
|
this.state = {
|
|
series: [44, 55, 13, 43, 22],
|
|
options: {
|
|
chart: {
|
|
width: 380,
|
|
type: "pie",
|
|
},
|
|
labels: ["Team A", "Team B", "Team C", "Team D", "Team E"],
|
|
responsive: [
|
|
{
|
|
breakpoint: 480,
|
|
options: {
|
|
chart: {
|
|
width: 200,
|
|
},
|
|
legend: {
|
|
position: "bottom",
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
};
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<>
|
|
<Card
|
|
sx={{
|
|
boxShadow: "none",
|
|
borderRadius: "10px",
|
|
p: "25px",
|
|
mb: "15px",
|
|
}}
|
|
>
|
|
<Typography
|
|
as="h3"
|
|
sx={{
|
|
fontSize: 18,
|
|
fontWeight: 500,
|
|
borderBottom: "1px solid #EEF0F7",
|
|
paddingBottom: "5px",
|
|
mb: "15px",
|
|
}}
|
|
className="for-dark-bottom-border"
|
|
>
|
|
Simple Pie Chart
|
|
</Typography>
|
|
|
|
<Chart
|
|
options={this.state.options}
|
|
series={this.state.series}
|
|
type="pie"
|
|
width={380}
|
|
/>
|
|
</Card>
|
|
</>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default SimplePieChart;
|