Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 1 year ago

Responsive bar chart using CSS flex

Maryam•260
@Maryam1982
A solution to the Expenses chart component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

The next time I won't forget instead of "height:100vh" I should set "min-height:100vh" (for body element to show as expected in responsive mode) I added animation to the chart but since container's height is not fixed (fit-content) the whole chart is animated not just bars,which i found cool!

What challenges did you encounter, and how did you overcome them?

Initially it seemes quite easy to me but as I progressed challenges started to show up. Positioning was first challenge because i was trying to center the chart both vertically and horizontally. Initially i set "height:100vh" (of body) but when on responsive mode it was shrinking. The solution was "min-height:100vh". Another challenge was chart scale. My solution was to find the maximum value and devide other values by max .

What specific areas of your project would you like help with?

Positioning and scaling (assigning relative heights to bars)

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Maryam's solution.

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License