Skip to content

fix: prevent AQI graph overflow on tablet landscape screens (#139)#148

Merged
Aditya8369 merged 1 commit into
Aditya8369:mainfrom
sahitya0xsingh:fix/aqi-overflow-139
Jul 11, 2026
Merged

fix: prevent AQI graph overflow on tablet landscape screens (#139)#148
Aditya8369 merged 1 commit into
Aditya8369:mainfrom
sahitya0xsingh:fix/aqi-overflow-139

Conversation

@sahitya0xsingh

@sahitya0xsingh sahitya0xsingh commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Description

This PR fixes an issue where the AQI and Pie charts on the Dashboard would overflow and break the layout on tablet-sized screens in landscape mode. By explicitly defining min-width: 0; on the CSS Grid/Flexbox .chart-card and .kpi-card containers, we ensure that the Recharts ResponsiveContainer correctly measures the available width and shrinks the charts accordingly instead of overflowing the viewport.


Related Issue

Closes #139


Type of Change

  • Bug Fix
  • New Feature
  • Documentation
  • UI/UX Improvement
  • Refactoring
  • Performance Improvement
  • Accessibility

Changes Made

  • Added min-width: 0; to the .chart-card class in src/styles.css to allow proper resizing of line and bar charts.
  • Added min-width: 0; to the .kpi-card class in src/styles.css to fix the pie chart sizing inside the grid.
  • Ensured Recharts ResponsiveContainer scales down appropriately on tablet landscape views.

Testing

  • Tested locally
  • No console errors
  • Existing functionality works as expected

Checklist

  • My code follows the project guidelines.
  • I have tested my changes.
  • I have updated the documentation if required.
  • My changes address the related issue.
  • This PR focuses on a single issue.

Additional Notes

The default behavior of CSS Grid track sizes (minmax(auto, 1fr)) prevents items from shrinking below the intrinsic minimum width of their contents. Adding min-width: 0 is the standard fix for canvas/SVG elements (like those rendered by Recharts) expanding infinitely inside grid layouts.

@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

@sahitya0xsingh is attempting to deploy a commit to the Aditya Mahajan's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pollution-control-hub Ready Ready Preview, Comment Jul 11, 2026 4:39am

@Aditya8369 Aditya8369 added the ECSoC26 Contributions considered under ECSoC'26 label Jul 11, 2026
@Aditya8369 Aditya8369 merged commit a744955 into Aditya8369:main Jul 11, 2026
3 checks passed
@github-actions

Copy link
Copy Markdown

🎉 Your PR just got merged, @sahitya0xsingh — thank you for contributing to Pollution Control Hub!

Your work is now part of the project. Here's what to do next:

  • ⭐ If you haven't already, consider giving the repo a star — it helps us grow.
  • 📢 Share your contribution on LinkedIn, Twitter, or wherever you hang out. You shipped open source!
  • 🔍 Browse other open issues if you want to keep contributing.

We really appreciate you taking the time. See you in the next PR! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ECSoC26-L1 ECSoC26 Contributions considered under ECSoC'26

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] AQI graph overflows on tablet landscape screens

2 participants