Skip to content
  • Learning paths
  • Challenges
  • Solutions
  • Articles
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 9 months ago

Responsive dynamic chart component using React and Tailwind CSS

react, tailwind-css, typescript, vite
Javier de Santiago•110
@javierdesant
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?

I'm getting used to Tailwind CSS with React, next time I will be able to create a visually appealing and responsive component more quickly.

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

Implementing dynamic data rendering and conditional styling based on the data was the hardest part.

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

I need help with the chart's hover functionality. I haven't been able to ensure that the parent's hover effect of the chart bars does not affect the child's opacity (the div that shows daily expenses on hover). How did you do it?

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Iván Fernández López•230
    @IvanFdez01
    Posted 9 months ago

    Hi, about your problem with hovers:

    • You have something like:
    <div bar>
        <div value></div>
    </div>
    

    This makes that if you apply opacity to bar, then is also applied on value, as they are nested.

    • Instead, you can do something like:
    <div cont>
        <div bar></div>
        <div value></div>
    </div>
    

    Where, in this case, cont would be the one who has position:relative and value would hace position:absolute (and special opacity etc). That would separate the styles for bar and value.

    Good job overall and by the way, what advantages can you obtain by modularizing as much as you have done? Maybe I don't know about frameworks and libraries yet, but is a genuine question as I'm always comfortable in my three .html, .css and .js files, but I see lots of modularized codes.

    Cheers friend.

    Marked as helpful
  • Joshua Abu•60
    @sirjaey
    Posted 9 months ago

    Great job1

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
Frontend Mentor logo

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

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub