From 47101e598845f7c1421608b4743cd682bf1c34a2 Mon Sep 17 00:00:00 2001
From: VineetBala-AOT <90332175+VineetBala-AOT@users.noreply.github.com>
Date: Thu, 26 Sep 2024 14:15:14 -0700
Subject: [PATCH] fix labels on pdf export (#89)
---
.../SurveyBarPrintable/index.tsx | 146 +++++++++---------
1 file changed, 76 insertions(+), 70 deletions(-)
diff --git a/met-web/src/components/publicDashboard/SurveyBarPrintable/index.tsx b/met-web/src/components/publicDashboard/SurveyBarPrintable/index.tsx
index 60d675a64..893a85427 100644
--- a/met-web/src/components/publicDashboard/SurveyBarPrintable/index.tsx
+++ b/met-web/src/components/publicDashboard/SurveyBarPrintable/index.tsx
@@ -8,7 +8,8 @@ import { SurveyResultData, createSurveyResultData } from '../../../models/analyt
import { BarChart, Bar, XAxis, YAxis, Tooltip, ResponsiveContainer, LabelList } from 'recharts';
import { DASHBOARD } from '../constants';
-const HEIGHT = 400;
+const minHeight = 400;
+const maxHeight = 1300;
interface SurveyQuestionProps {
engagement: Engagement;
@@ -21,12 +22,6 @@ export const SurveyBarPrintable = ({ engagement, engagementIsLoading, dashboardT
const [isLoading, setIsLoading] = useState(true);
const [isError, setIsError] = useState(false);
- const minHeight = 400;
- const maxHeight = 1300;
-
- const numberOfCategories = data?.data[0]?.result?.length ?? 0;
- const height = Math.min(Math.max(numberOfCategories * 40, minHeight), maxHeight);
-
const fetchData = async () => {
setIsLoading(true);
try {
@@ -52,7 +47,7 @@ export const SurveyBarPrintable = ({ engagement, engagementIsLoading, dashboardT
}, [engagement.id]);
if (isLoading || engagementIsLoading) {
- return