86 lines
1.8 KiB
JavaScript
86 lines
1.8 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 MonochromePie extends Component {
|
|
|
|
constructor(props) {
|
|
super(props);
|
|
|
|
this.state = {
|
|
|
|
series: [25, 15, 44, 55, 41, 17],
|
|
options: {
|
|
chart: {
|
|
width: '100%',
|
|
type: 'pie',
|
|
},
|
|
labels: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
theme: {
|
|
monochrome: {
|
|
enabled: true
|
|
}
|
|
},
|
|
plotOptions: {
|
|
pie: {
|
|
dataLabels: {
|
|
offset: -5
|
|
}
|
|
}
|
|
},
|
|
title: {
|
|
text: "Monochrome Pie"
|
|
},
|
|
dataLabels: {
|
|
formatter(val, opts) {
|
|
const name = opts.w.globals.labels[opts.seriesIndex]
|
|
return [name, val.toFixed(1) + '%']
|
|
}
|
|
},
|
|
legend: {
|
|
show: false
|
|
}
|
|
},
|
|
|
|
|
|
};
|
|
}
|
|
|
|
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"
|
|
>
|
|
Monochrome Pie
|
|
</Typography>
|
|
|
|
<Chart options={this.state.options} series={this.state.series} type="pie" />
|
|
</Card>
|
|
</>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default MonochromePie;
|