Skip to content

Commit

Permalink
bug fixed in pieCharts
Browse files Browse the repository at this point in the history
  • Loading branch information
jitheshm committed Sep 19, 2024
1 parent 70e01c6 commit 32f1b1b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions frontend/src/components/Charts/PieChart.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
import * as React from 'react';
import { PieChart } from '@mui/x-charts/PieChart';
import { PieValueType } from '@mui/x-charts/models';
import { useTheme } from 'next-themes';

interface PieChartsProps {
data: PieValueType[];
}

function PieCharts({ data }: PieChartsProps) {

const { theme, setTheme } = useTheme()
const labelColor = theme === 'dark' ? 'white' : 'black'; // Set label color based on theme

return (
<PieChart
series={[
{
data,
},
]}

height={200}
className='text-white mx-auto '

className="mx-auto"
slotProps={{
legend: {

labelStyle: {
fill: 'white',

fill: labelColor,
},
},
}}
Expand Down

0 comments on commit 32f1b1b

Please sign in to comment.