Skip to content

Commit

Permalink
changed reports to pet type
Browse files Browse the repository at this point in the history
  • Loading branch information
aashiyaaaa committed May 13, 2024
1 parent dff261b commit b2614da
Show file tree
Hide file tree
Showing 4 changed files with 325 additions and 835 deletions.
128 changes: 60 additions & 68 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"html2canvas": "^1.4.1",
"jspdf": "^2.5.1",
"jspdf-autotable": "^3.8.2",
"next": "14.0.4",
"next": "^14.2.3",
"react": "^18",
"react-datepicker": "^6.6.0",
"react-dom": "^18",
Expand Down
9 changes: 6 additions & 3 deletions frontend/src/app/reports/Chart.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';
import { useEffect, useState, useRef, MouseEvent } from 'react';
import ChartJS from 'chart.js/auto';
import { calcAllLbsPerBrand, calculateLbsPerBrand } from './Dashboard';
import { calculateLbsPerAnimal } from './Dashboard';
import { Button } from '@/components/core/Button';
import jsPDF from 'jspdf';
import 'jspdf-autotable';
Expand Down Expand Up @@ -37,9 +37,9 @@ const Chart: React.FC<{
// Extracting data for the chart
const labels: string[] = data.map((item: any) => item.foodItems.brand);
const allFoodOrdersData: { [key: string]: number } =
calcAllLbsPerBrand(exportable);
calculateLbsPerAnimal(exportable);
const foodOrdersData: { [key: string]: number } =
calculateLbsPerBrand(data);
calculateLbsPerAnimal(data);

const costs: number[] = data.map((item: any) => item['Total cost ($)']);
const colors: string[] = [
Expand All @@ -48,6 +48,9 @@ const Chart: React.FC<{
'#A9BCFF',
'#FFCF33',
'#92E08B',
'#FFCF33',
'#A9BCFF',
'#FFB7A9'
];
const colors1: string[] = [
'#fbd4db',
Expand Down
Loading

0 comments on commit b2614da

Please sign in to comment.