Library / SDK
ChartsCSS/charts.css avatar
ChartsCSS/charts.css

Charts.css: turning an HTML table into a chart with CSS classes

Open source CSS framework for data visualization.

6,585 stars178 forksHTMLMIT

At a glance

What is it?
Charts.css is an MIT-licensed CSS framework that renders data visualizations from semantic HTML tables and inline CSS variables. It suits server-rendered pages and static sites where a JavaScript charting library is more machinery than the job needs.
Who is it for?
Charts.css is a good fit for server-rendered pages, static sites and email-adjacent HTML where you want a chart without shipping a JavaScript runtime, and for teams already comfortable writing CSS. It is the wrong tool when you need tooltips, zoom, live data updates or animation driven by user interaction, because the README documents no JavaScript API at all.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Activity is slowing. The repository last received commits 7 months ago.
What is it written in?
Mainly HTML, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • ChartsCSS/charts.css6,585 ★ · +2
Star history
Repository2026-09-232026-11-15
ChartsCSS/charts.css6.6k6.6k

2 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

What problem Charts.css solves, and for whom

Most charting libraries require you to hand your data to JavaScript, which then writes SVG or canvas into the page. Charts.css takes the opposite route. The README describes it as an open source CSS framework for data visualization, and the usage example is a plain HTML table with classes on it. The data lives in the markup, the appearance lives in CSS.

That matters for a specific kind of page. If your data is already rendered server-side, the framework lets you style it without adding a client-side rendering step. The README states there are no dependencies, and gives the minified size as 58.4kb, or 5.9kb gzipped. A table of figures is also readable when the stylesheet fails to load, which is not true of a canvas element.

The audience is frontend developers who are comfortable targeting HTML elements with CSS. The README calls this the key feature: the ability to customize everything using basic CSS. If you would rather configure a chart through a JavaScript options object, this framework will feel like the wrong shape.

How the table markup becomes a chart

The mechanism is a CSS custom property named --size applied to cells. In the README example, each row of the table body holds a year in a th and a value in a td, and the td carries an inline style such as --size: calc( 40 / 100 ). The stylesheet reads that variable and sizes the visual bar from it. There is no data attribute carrying the number and no script reading the DOM.

Classes on the table element control the rest. The example uses column to select the chart type, show-primary-axis and show-4-secondary-axes to draw axes, and data-spacing-4 and reverse-data to adjust spacing and direction. The README presents these as bracketed optional groups, which signals that they compose rather than being mutually exclusive settings.

The consequence is that your data pipeline has to produce the ratio, not the raw number, or produce both. In the README the visible text is $ 40K while the variable is 40/100, so the same row carries a human-readable label and a normalized value. If your backend emits raw values only, you either compute the ratio in the template or write the raw value into the variable and accept that the scale is whatever the maximum happens to be.

Installing Charts.css and building a first chart

The README gives two installation routes. The fastest is a stylesheet link from a CDN, which needs no build step at all. Drop this into the head of your page:

html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/charts.css/dist/charts.min.css">

The README also lists unpkg as an alternative host for the same dist/charts.min.css path. If you would rather keep the file local, install it as a package. Note the package name contains a dot:

bash
npm install charts.css

Yarn works the same way with yarn add charts.css. The package entry point is dist/charts.min.css, and the published files list contains only dist/charts.css, dist/charts.css.map and dist/charts.min.css.

With the stylesheet loaded, a minimal chart is a table with the charts-css class, a chart type class, and one --size value per row. This is the README's structure reduced to three rows:

html
<table class="charts-css column">
  <caption> Front End Developer Salary </caption>
  <tbody>
    <tr><th scope="row"> 2016 </th><td style="--size: calc( 40 / 100 );"> $ 40K </td></tr>
    <tr><th scope="row"> 2017 </th><td style="--size: calc( 60 / 100 );"> $ 60K </td></tr>
    <tr><th scope="row"> 2018 </th><td style="--size: calc( 75 / 100 );"> $ 75K </td></tr>
  </tbody>
</table>

What you should see is three columns of increasing height, with the row headers as labels. If the columns render but the heights are all equal, the --size declaration is not reaching the cell, which usually means the style attribute was stripped by a sanitizer or a templating layer. Add the axis classes from the README example, show-primary-axis and show-4-secondary-axes, once the bars appear, and the framework draws the reference lines.

Where Charts.css stops being the right tool

The framework has no JavaScript layer. The README documents classes and CSS variables, and the repository's package.json scripts are all build and test steps: sass compilation, autoprefixer, cssnano, stylelint and Playwright. There is no runtime module in the published files. Anything that requires recomputing on the client, such as a tooltip that follows the pointer, a zoom control, or a chart that redraws when a filter changes, has to be built by you on top of the markup.

Accessibility is another boundary to check rather than assume. A table with a caption, thead and scope attributes is announced as a table, which is a reasonable baseline, but the README does not describe how the visual bars relate to the text for assistive technology, and it does not document any ARIA attributes. If a screen reader experience is a hard requirement, verify it yourself with the chart type you intend to ship.

There is also a scaling limit that falls out of the --size design. Because the value is a ratio you supply, the framework cannot infer a sensible axis from the data. The README example divides each value by 100, so bar heights are relative to a maximum you chose rather than one derived from the data. Change the data and the picture changes shape unless you recompute every ratio. For a chart that must stay comparable across datasets, that is work you own.

Charts.css compared with Chart.js

Chart.js is the natural comparison because it is the tool most people reach for first. The difference is where the rendering happens. Chart.js takes a data array and a configuration object, draws to a canvas element, and gives you interaction, animation and tooltips as part of the library. Charts.css takes markup you already have and styles it, and gives you none of those behaviours.

That split decides the choice more than any feature list. A canvas chart is opaque to the DOM, so text selection, print stylesheets and CSS-based theming do not apply to it in the usual way. A Charts.css table is ordinary HTML, so your existing CSS, your print styles and your server-side templating all keep working. The trade is that you give up everything that requires a redraw loop.

Bundle size is where the comparison is less one-sided than it looks. The README puts Charts.css at 5.9kb gzipped, which is small, but a project already loading a JavaScript framework for other reasons may not save much by avoiding a charting library. The real argument for Charts.css is architectural, not byte count: it keeps the chart in the document instead of beside it.

Maintenance, licence and the cost of upgrading

Charts.css is MIT licensed, which permits commercial use, modification and redistribution provided the copyright notice and permission notice are preserved. That is a permissive arrangement with few obligations, but it is not legal advice, and if you redistribute the framework inside a product you should read the LICENSE file in the repository rather than rely on a summary.

The release history is uneven. Version 1.0.1 shipped on 2023-09-30, 1.1.0 followed on 2023-10-18, and 1.2.0 arrived on 2025-07-21. The last push to the default branch was on 2026-04-04. So there is activity in the repository, but the gap between 1.1.0 and 1.2.0 was roughly twenty-one months, which tells you that minor releases are not frequent. Plan upgrades around that rhythm rather than expecting a steady stream.

Upgrade cost is low in one respect and uncertain in another. The published artifact is a single CSS file, so swapping versions is a file replacement. But the framework's power comes from CSS variables and class combinations that the README does not enumerate; the documentation site is the reference. If you override those variables heavily, a minor release can change rendering without changing the API surface. Pin the version you ship and read the release notes before moving.

Editorial conclusion

Charts.css is a good fit for server-rendered pages, static sites and email-adjacent HTML where you want a chart without shipping a JavaScript runtime, and for teams already comfortable writing CSS. It is the wrong tool when you need tooltips, zoom, live data updates or animation driven by user interaction, because the README documents no JavaScript API at all. Before adopting it, open the examples page and the customization page on ChartsCSS.org, confirm that the chart type you need is covered, and check whether the table markup you already generate can carry the --size values. Also decide where the CSS file comes from: the npm package ships only dist/charts.css, dist/charts.css.map and dist/charts.min.css, so the SCSS in src/ is not part of the published artifact.

Frequently asked questions

How do I install Charts.css?

You can link the stylesheet directly from jsdelivr or unpkg at the dist/charts.min.css path, or install it as a package with npm install charts.css or yarn add charts.css. The package entry point is dist/charts.min.css.

How do I make a chart in HTML with Charts.css?

Build a semantic table with the charts-css class and a chart type class such as column, then set a --size custom property on each td, for example style="--size: calc( 40 / 100 );". The README shows axis and spacing classes added to the same table element.

How is Charts.css different from Chart.js?

Chart.js takes a data array and configuration object and draws to a canvas, with interaction and animation included. Charts.css styles existing HTML table markup with classes and CSS variables, so there is no client-side rendering step and no built-in interactivity.

Official sources

  1. ChartsCSS/charts.css on GitHub
  2. License: MIT
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/chartscss-charts-css.svg)](https://hysenlabs.com/projects/chartscss-charts-css)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/chartscss-charts-css.svg)](https://hysenlabs.com/projects/chartscss-charts-css)

Was this useful?