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

Dynamic Expense Chart(Data Loaded from JSON) using HTML, CSS and JS.

Junaeid•100
@devjunaeid
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?

What am I most proud of? The fact that I pulled off a dynamic chart using vanilla JS and CSS. It was fun to work with vanilla JS because I usually work with React.

What I would do differently next time? I think the active sate(hover to show individual expenses) could be done better. So, I'm open to any suggestion.

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

I tried to import JSON directly using import keyword.

import data from "./data.json" this line gives an error. JavaScript module script but the server responded with a MIME type of "application/json"

Solved it using the following import.(with the help of internet)

import data from "./data.json" assert{type: "json"}

Learn More about Import Assertions here..

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 Junaeid'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