Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 3 years ago

Expenses Chart Component - Dynamic chart, Accessibility, Flexbox

accessibility, cube-css
Adam Wozniak•230
@adamwozhere
A solution to the Expenses chart component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I learned more about javascript for this project, in particular, async and await. I think the code could be better using separate functions to make it more re-usable in a larger project, but it works for this small example.

I found I could make the graph work with the JSON data and include it as a table in the markup; this should make it more accessible for screen-readers while the styling makes it display like a chart -- chartscss.org was very helpful in working out how to do this.

I did find some of the styling difficult: in particular the bottom summary section because of the different type sizes, and the change between the mobile and desktop views. I found that I needed to adjust the line-heights for specific text elements which seemed a bit haphazard; perhaps it would be better to reduce line-heights to zero then use margin-top on specific elements, or maybe there is a different, more organised way of doing this?

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 Adam Wozniak'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
  • Use cases

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