
"use client"
import dynamic from "next/dynamic";
const Chart = dynamic(() => import("react-apexcharts"), { ssr: false });
import { useTheme } from '@mui/material/styles';
import React from "react";
const BCrumb = [
{
to: '/',
title: 'Home',
},
{
title: 'Doughtnut Chart',
},
];
const DoughnutChart = () => {
// chart color
const theme = useTheme();
const primary = theme.palette.primary.main;
const primarylight = theme.palette.primary.light;
const secondary = theme.palette.secondary.main;
const secondarylight = theme.palette.secondary.light;
const warning = theme.palette.warning.main;
// 1
const optionsdoughnutchart = {
chart: {
id: 'donut-chart',
fontFamily: "'Plus Jakarta Sans', sans-serif",
foreColor: '#adb0bb',
},
dataLabels: {
enabled: false,
},
plotOptions: {
pie: {
donut: {
size: '70px',
},
},
},
legend: {
show: true,
position: 'bottom',
width: '50px',
},
colors: [primary, primarylight, secondary, secondarylight, warning],
tooltip: {
theme: 'dark',
fillSeriesColor: false,
},
};
const seriesdoughnutchart = [45, 15, 27, 18, 35];
return (
<Chart
options={optionsdoughnutchart}
series={seriesdoughnutchart}
type="donut"
height="300px"
width={"100%"}
/>
);
};
export default DoughnutChart;
"use client"
import dynamic from "next/dynamic";
const Chart = dynamic(() => import("react-apexcharts"), { ssr: false });
import { useTheme } from '@mui/material/styles';
import React from "react";
const BCrumb = [
{
to: '/',
title: 'Home',
},
{
title: 'Doughtnut Chart',
},
];
const PieCharts = () => {
// chart color
const theme = useTheme();
const primary = theme.palette.primary.main;
const primarylight = theme.palette.primary.light;
const secondary = theme.palette.secondary.main;
const secondarylight = theme.palette.secondary.light;
const warning = theme.palette.warning.main;
// 1
const optionsdoughnutchart = {
chart: {
id: 'donut-chart',
fontFamily: "'Plus Jakarta Sans', sans-serif",
foreColor: '#adb0bb',
},
dataLabels: {
enabled: false,
},
plotOptions: {
pie: {
donut: {
size: '70px',
},
},
},
legend: {
show: true,
position: 'bottom',
width: '50px',
},
colors: [primary, primarylight, secondary, secondarylight, warning],
tooltip: {
theme: 'dark',
fillSeriesColor: false,
},
};
const seriesdoughnutchart = [45, 15, 27, 18, 35];
// 2
const optionspiechart = {
chart: {
id: 'pie-chart',
fontFamily: "'Plus Jakarta Sans', sans-serif",
foreColor: '#adb0bb',
toolbar: {
show: false,
},
},
dataLabels: {
enabled: false,
},
plotOptions: {
pie: {
donut: {
size: '70px',
},
},
},
legend: {
show: true,
position: 'bottom',
width: '50px',
},
colors: [primary, primarylight, secondary, secondarylight, warning],
tooltip: {
fillSeriesColor: false,
},
};
const seriespiechart = [45, 15, 27, 18, 35];
return (
<Chart options={optionspiechart} series={seriespiechart} type="pie" height="300px" width={"100%"} />
);
};
export default PieCharts;