I've written about bar charts in HTML & CSS Grid and how they make responsive design, internationalization and accessibility easier than SVG & JS layouting.

https://9elements.com/blog/responsive-bar-charts-in-html-and-css/

Collaboration with @nilsbinder and @sphinxc0re.

#html #css #dataviz

Responsive bar charts in HTML and CSS - 9elements

Combining finest craftsmanship with elegant design to ship innovative digital experiences.

9elements

Here's the link to the CodePen if you'd like to have a look at the final code:

https://codepen.io/molily/pen/PovgeGK

Bar chart

...

@molily Removed .tick-line elements and moved the line as a pseudo element into .tick-value which is now a flex container that spans to the given --grid-row-count.

There also is no longer a need to define grid-template-rows. Giving the --grid-row-count is also optional, it defaults to spanning to a value of 100.

https://codepen.io/Merri/pen/XWLrwGv

Bar chart

...

@molily Additionally this fork removes need for setting the inset-inline-start value for each .tick-value by using a flex container on .ticks:

https://codepen.io/Merri/pen/PorYvvE

(Edit: also switched to `visibility: hidden;` over `opacity: 0; user-select: none;`)

Bar chart

...

@MerriNet Thanks again, Vesa!
I've updated the article: https://9elements.com/blog/responsive-bar-charts-in-html-and-css/
It now embeds this CodePen: https://codepen.io/molily/pen/JjqgxVR?editors=1100 which includes several of your ideas.
I've mentioned your contributions in the article and linked to your CodePen as well. Are you fine with that? Any wishes? ☺️
Responsive bar charts in HTML and CSS - 9elements

Combining finest craftsmanship with elegant design to ship innovative digital experiences.

9elements