An excellent advantage of using CSS involves being able to chart numerical data instead of adding static images to your website. Not only will this add to the aesthetic value of your website but it will make your content more accessible.
So, with that said, here are 4 CSS techniques for charting data:
#1: Accessible/ Definition List Bar Chart
In this case, you can use an accessible bar chart which uses a table as the basic structure of the bar graph. CSS is used so as to stretch a background image to its appropriate width. You can also create definition list bar charts, as horizontal charts, whose width can adjusted using percentage units.
#2: Graphs using Percentage Background Images
With this technique, premade background images are made so as to shade in the appropriate data. The only problem with using this type of graph will be that there are limited number of premade background images, and you’ll have to create more of them in order to increase the number of classes. But that’s not all – your CSS and HTML file size will increase while the number of HTTP connections to render the page will also increase, thanks to these background images.
#3: CSS Scatter Plot
If you need to plot two-dimensional data, then a scatter plot is the best way to do so. When you use this in CSS, each data point is clickable. So, you can use a modal window which will display extra information about each data point.