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

Expenses-chart-component

react, sass/scss
Abdelouahed el yahiaoui•150
@ab77-oss
A solution to the Expenses chart component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


The challenge in this component is, how to transform the values of the JSON data to a shape and background color, and how in case of a change occurred in the data, the bars change also accordingly. The challenge was a great opportunity for me to get a deep understanding of some notions in React js especially the hooks, the event in javascript.

the use of useEffect enabled me to put the background for all the bars taking into consideration the bar with the maximum amount, also the use of the style inline for the height enabled me to draw the shape of the bar.

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 Abdelouahed el yahiaoui'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