Charts.css

Open source CSS framework for data visualization.

README

Charts.css Logo

Charts.css


GitHub Version Minified Size GitHub Repo stars License

Charts.css is an open source CSS framework for data visualization.

Visualization help end-users understand data. Charts.css help frontend developers turn data into beautiful charts and graphs using simple CSS classes.

No dependencies. 72kb file size. Less than 6kb gzipped file size!

Documentation


Check the full documentation on ChartsCSS.org.


Installation


CDN


Use jsdelivr CDN:

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

Or unpkg CDN:

  1. ``` html
  2. <link rel="stylesheet" href="https://unpkg.com/charts.css/dist/charts.min.css">
  3. ```

Package Manager


Install using npm:

  1. ``` sh
  2. npm install charts.css
  3. ```

Or using yarn:

  1. ``` sh
  2. yarn add charts.css
  3. ```

Usage


The data is structured using semantic HTML tags and styled using CSS classes which change the visual representation displayed to the end user.

  1. ``` html
  2. <table class="charts-css [ column ] [ show-primary-axis show-4-secondary-axes ] [ data-spacing-4 reverse-data ]">
  3. <caption> Front End Developer Salary </caption>
  4. <thead>
  5.     <tr>
  6.       <th scope="col"> Year </th>
  7.       <th scope="col"> Income </th>
  8.     </tr>
  9.   </thead>
  10. <tbody>
  11.     <tr>
  12.       <th scope="row"> 2016 </th>
  13.       <td style="--size: calc( 40 / 100 );"> $ 40K </td>
  14.     </tr>
  15.     <tr>
  16.       <th scope="row"> 2017 </th>
  17.       <td style="--size: calc( 60 / 100 );"> $ 60K </td>
  18.     </tr>
  19.     <tr>
  20.       <th scope="row"> 2018 </th>
  21.       <td style="--size: calc( 75 / 100 );"> $ 75K </td>
  22.     </tr>
  23.     <tr>
  24.       <th scope="row"> 2019 </th>
  25.       <td style="--size: calc( 90 / 100 );"> $ 90K </td>
  26.     </tr>
  27.     <tr>
  28.       <th scope="row"> 2020 </th>
  29.       <td style="--size: calc( 100 / 100 );"> $ 100K <br> 👑 </td>
  30.     </tr>
  31.   </tbody>
  32. </table>
  33. ```

The framework offers developers flexibility. You choose what components to display and how to style them. Each component offers several CSS classes and CSS variables to customizes your style.

The key feature is the ability to customize everything using basic CSS. Frontend developers can target any HTML element and customize it. This philosophical guideline is what makes the framework so flexible, easy and fun to use.

Questions


For questions and support please use the official forum on GitHub.

Liked Charts.css?


If you like the project, please consider to star the repo on GitHub.

License


Charts.css is licensed under the MIT license.