joco-sveltekit icon indicating copy to clipboard operation
joco-sveltekit copied to clipboard

blog/css-grid-bar-charts

Open utterances-bot opened this issue 3 years ago • 4 comments

Creating dynamic bar charts with CSS grid - Josh Collinsworth blog

How to use CSS grid to make a responsive, adaptable bar chart with no math or external library required!

https://joshcollinsworth.com/blog/css-grid-bar-charts

utterances-bot avatar Jun 07 '22 08:06 utterances-bot

Totally awesome Josh! Thanks for sharing. I will definitely use it!

chezchez avatar Jun 07 '22 08:06 chezchez

Really cool - I was also thinking about this good use case!

side point - maybe you know why as in your screenshot: https://joshcollinsworth.com/images/post_images/grid-auto-columns.png

when you set grid-auto-colums: 1fr

then the grid columns indicators on top skip #2 ???

hey68you avatar Jun 07 '22 08:06 hey68you

Great article and use of grid. I think you can upgrade your code by using css-variables in your inline-style. in the css: grid-column: var(--col-span); inside the HTML: <li style="--col-span: 9"> https://codepen.io/rachelbt/pen/BaYObgr

rachelbt avatar Jun 08 '22 05:06 rachelbt

sorry - for the css: grid-column: span var(--col-span);

rachelbt avatar Jun 08 '22 05:06 rachelbt