From 656b01f82aa2e228af12e05681534975f07d0a09 Mon Sep 17 00:00:00 2001 From: Mohammad Jalali Date: Sat, 18 Nov 2023 10:50:56 +0330 Subject: [PATCH] LFFE-10 complete responsive part of charts --- .../dashboard/reports/LoanDistribution/PieChart.jsx | 8 ++++++++ .../dashboard/reports/LoanDistribution/PolarChart.jsx | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/src/components/dashboard/reports/LoanDistribution/PieChart.jsx b/src/components/dashboard/reports/LoanDistribution/PieChart.jsx index 8b26443..4475355 100644 --- a/src/components/dashboard/reports/LoanDistribution/PieChart.jsx +++ b/src/components/dashboard/reports/LoanDistribution/PieChart.jsx @@ -1,6 +1,11 @@ import Chart from "@/core/components/Chart"; +import {useTheme} from "@mui/material/styles"; + const Pie = ({data}) => { + const theme = useTheme(); + const windowsWidth = window.innerWidth; + console.log(windowsWidth <= theme.breakpoints.values.sm) const specialOption = { title: { text: undefined, @@ -16,6 +21,9 @@ const Pie = ({data}) => { fontWeight: 300, }, }, + legend: { + show: windowsWidth > theme.breakpoints.values.sm + } }; const series = data.map((item) => +item.percentage) return ( diff --git a/src/components/dashboard/reports/LoanDistribution/PolarChart.jsx b/src/components/dashboard/reports/LoanDistribution/PolarChart.jsx index 974f93d..b821cec 100644 --- a/src/components/dashboard/reports/LoanDistribution/PolarChart.jsx +++ b/src/components/dashboard/reports/LoanDistribution/PolarChart.jsx @@ -1,6 +1,10 @@ import Chart from "@/core/components/Chart"; +import {useTheme} from "@mui/material/styles"; const PolarChart = ({data}) => { + const theme = useTheme(); + const windowsWidth = window.innerWidth; + console.log(windowsWidth <= theme.breakpoints.values.sm) const specialOption = { title: { text: undefined, @@ -24,6 +28,9 @@ const PolarChart = ({data}) => { fontWeight: 400, }, }, + legend: { + show: windowsWidth > theme.breakpoints.values.sm + } }; const series = data.map((item) => +item.percentage) return (