From e1992250903acb3e5371c3e1a2b2c4f49384cae0 Mon Sep 17 00:00:00 2001 From: David Inga Date: Fri, 1 Mar 2024 11:22:58 +0100 Subject: [PATCH] added supplier chart --- .../suppliers-stacked-bar/component.tsx | 185 ++++++++++++++++++ .../suppliers-stacked-bar/index.ts | 1 + client/src/pages/eudr/index.tsx | 8 +- 3 files changed, 188 insertions(+), 6 deletions(-) create mode 100644 client/src/containers/analysis-eudr/suppliers-stacked-bar/component.tsx create mode 100644 client/src/containers/analysis-eudr/suppliers-stacked-bar/index.ts diff --git a/client/src/containers/analysis-eudr/suppliers-stacked-bar/component.tsx b/client/src/containers/analysis-eudr/suppliers-stacked-bar/component.tsx new file mode 100644 index 000000000..b5cfc0a7b --- /dev/null +++ b/client/src/containers/analysis-eudr/suppliers-stacked-bar/component.tsx @@ -0,0 +1,185 @@ +import React from 'react'; +import { + BarChart, + Bar, + XAxis, + YAxis, + CartesianGrid, + Tooltip, + ResponsiveContainer, + Label, +} from 'recharts'; + +import { Button } from '@/components/button'; + +const data = [ + { + name: 'Cattle', + uv: 40, + pv: 30, + amt: 30, + }, + { + name: 'Cocoa', + uv: 30, + pv: 13, + amt: 57, + }, + { + name: 'Coffee', + uv: 20, + pv: 70, + amt: 10, + }, + { + name: 'Oil palm', + uv: 27, + pv: 39, + amt: 34, + }, + { + name: 'Wood', + uv: 28, + pv: 48, + amt: 24, + }, + { + name: 'Soya', + uv: 23, + pv: 38, + amt: 39, + }, + { + name: 'Rubber', + uv: 34, + pv: 43, + amt: 23, + }, +]; + +const SuppliersStackedBar = () => { + return ( +
+
+
+ Total numbers of suppliers: 46.53P +
+
+

Suppliers by category

+
+
View by:
+
+
+
+
+ + + + + } + /> + ( + + + {payload.value} + + + )} + tickLine={false} + type="category" + width={200} + /> + + + + + + +
+
+
+
Deforestation-free suppliers
+
+
+ 31% of suppliers +
+
+
+
+
+
+ +
+
+
+
Suppliers with deforestation alerts
+
+
+ 36% of suppliers +
+
+
+
+
+
+ +
+
+
+
Suppliers with no location data
+
+
+ 33% of suppliers +
+
+
+
+
+
+ +
+
+
+
+ ); +}; + +export default SuppliersStackedBar; diff --git a/client/src/containers/analysis-eudr/suppliers-stacked-bar/index.ts b/client/src/containers/analysis-eudr/suppliers-stacked-bar/index.ts new file mode 100644 index 000000000..b404d7fd4 --- /dev/null +++ b/client/src/containers/analysis-eudr/suppliers-stacked-bar/index.ts @@ -0,0 +1 @@ +export { default } from './component'; diff --git a/client/src/pages/eudr/index.tsx b/client/src/pages/eudr/index.tsx index cc110951d..4b36c6fda 100644 --- a/client/src/pages/eudr/index.tsx +++ b/client/src/pages/eudr/index.tsx @@ -8,6 +8,7 @@ import CollapseButton from 'containers/collapse-button/component'; import TitleTemplate from 'utils/titleTemplate'; import Map from 'components/map'; import LayerManager from 'components/map/layer-manager'; +import SuppliersStackedBar from '@/containers/analysis-eudr/suppliers-stacked-bar'; import type { NextPageWithLayout } from 'pages/_app'; import type { ReactElement } from 'react'; @@ -42,12 +43,7 @@ const MapPage: NextPageWithLayout = () => {

EUDR complience Analysis

-
-
- Total numbers of suppliers: 46.53P -
-

Suppliers by category

-
+