From 7c24b55eb385ed093ad9405cae0f7a1dc290d066 Mon Sep 17 00:00:00 2001 From: Mohammad Jalali Date: Sat, 4 Nov 2023 17:16:27 +0330 Subject: [PATCH] LFFE-10 bring two chart (polar/bar) --- src/components/dashboard/reports/BarChart.jsx | 40 +++++++++++++++++ .../dashboard/reports/PolarChart.jsx | 39 +++++++++++++++++ src/components/dashboard/reports/index.jsx | 43 +++++++++++++++++-- .../dashboard/expert-management/index.jsx | 2 +- src/pages/dashboard/reports/index.jsx | 11 ++--- 5 files changed, 123 insertions(+), 12 deletions(-) create mode 100644 src/components/dashboard/reports/BarChart.jsx create mode 100644 src/components/dashboard/reports/PolarChart.jsx diff --git a/src/components/dashboard/reports/BarChart.jsx b/src/components/dashboard/reports/BarChart.jsx new file mode 100644 index 0000000..461b01f --- /dev/null +++ b/src/components/dashboard/reports/BarChart.jsx @@ -0,0 +1,40 @@ +import {Grid} from "@mui/material"; +import Chart from "@/core/components/Chart"; + +const DashboardReportsComponent = (props) => { + const specialOption = { + title: { + text: "مامامیا ماماسیتا", + align: "center" + }, + plotOptions: { + bar: { + borderRadius: 1, + horizontal: false, + } + }, + dataLabels: { + enabled: true + }, + }; + const series = [{ + name: 'اطلاعی ندارم', + data: [ + {x: 'قم', y: 300}, + {x: 'شیراز', y: 240}, + {x: 'اصفهان', y: 190}, + {x: 'تهران', y: 150}, + {x: 'کرج', y: 120}, + {x: 'زنجان', y: 250}, + {x: 'سیستان بلوچستان', y: 180}, + {x: 'هرمزگان', y: 260} + ] + }] + return ( + + + + ) +}; + +export default DashboardReportsComponent; \ No newline at end of file diff --git a/src/components/dashboard/reports/PolarChart.jsx b/src/components/dashboard/reports/PolarChart.jsx new file mode 100644 index 0000000..4af549a --- /dev/null +++ b/src/components/dashboard/reports/PolarChart.jsx @@ -0,0 +1,39 @@ +import {Grid} from "@mui/material"; +import Chart from "@/core/components/Chart"; + +const DashboardReportsComponent = (props) => { + const specialOption = { + title: { + text: "مامامیا ماماسیتا", + align: "center" + }, + stroke: { + colors: ['#fff'] + }, + responsive: [{ + breakpoint: 480, + options: { + chart: { + width: 200 + }, + legend: { + position: 'bottom' + } + } + }], + dataLabels: { + enabled: true + }, + }; + const series = [{ + name: 'اطلاعی ندارم', + data: [14, 23, 21, 17, 15, 10, 12, 17, 21] + }] + return ( + + + + ) +}; + +export default DashboardReportsComponent; \ No newline at end of file diff --git a/src/components/dashboard/reports/index.jsx b/src/components/dashboard/reports/index.jsx index 3b9665d..681b1ca 100644 --- a/src/components/dashboard/reports/index.jsx +++ b/src/components/dashboard/reports/index.jsx @@ -1,5 +1,42 @@ -const DashboardReportsComponent = (props) => ( - <>hiiiiii -); +import {Grid} from "@mui/material"; +import BarChart from "@/components/dashboard/reports/BarChart"; +import PolarChart from "@/components/dashboard/reports/PolarChart"; + +const DashboardReportsComponent = (props) => { + const specialOption = { + title: { + text: "مامامیا ماماسیتا", + align: "center" + }, + plotOptions: { + bar: { + borderRadius: 1, + horizontal: false, + } + }, + dataLabels: { + enabled: true + }, + }; + const series = [{ + name: 'اطلاعی ندارم', + data: [ + {x: 'قم', y: 300}, + {x: 'شیراز', y: 240}, + {x: 'اصفهان', y: 190}, + {x: 'تهران', y: 150}, + {x: 'کرج', y: 120}, + {x: 'زنجان', y: 250}, + {x: 'سیستان بلوچستان', y: 180}, + {x: 'هرمزگان', y: 260} + ] + }] + return ( + + + + + ) +}; export default DashboardReportsComponent; \ No newline at end of file diff --git a/src/pages/dashboard/expert-management/index.jsx b/src/pages/dashboard/expert-management/index.jsx index eab73fc..2db2389 100644 --- a/src/pages/dashboard/expert-management/index.jsx +++ b/src/pages/dashboard/expert-management/index.jsx @@ -14,7 +14,7 @@ export async function getServerSideProps({req, locale}) { messages: (await import(`&/locales/${locale}/app.json`)).default, title: "Dashboard.expert_management", isBot, - layout: {name: 'DashboardLayout', props: {permissions: ["manage_transportation_navgan"]}} + layout: {name: 'DashboardLayout', props: {permissions: ["manage_experts"]}} }, }; } diff --git a/src/pages/dashboard/reports/index.jsx b/src/pages/dashboard/reports/index.jsx index 4590184..9dba421 100644 --- a/src/pages/dashboard/reports/index.jsx +++ b/src/pages/dashboard/reports/index.jsx @@ -1,15 +1,9 @@ -import WithAuthMiddleware from "@/middlewares/WithAuth"; -import {parse} from "next-useragent"; import DashboardReportsComponent from "@/components/dashboard/reports"; +import {parse} from "next-useragent"; -// const requiredPermissions = ["reports"]; export default function Reports() { return ( - - {/**/} - - {/**/} - + ); } @@ -20,6 +14,7 @@ export async function getServerSideProps({req, locale}) { messages: (await import(`&/locales/${locale}/app.json`)).default, title: "Dashboard.reports", isBot, + layout: {name: 'DashboardLayout'} }, }; }