UNPKG

3.14 kBMarkdownView Raw
1# Charts.css
2
3![GitHub Version](https://img.shields.io/github/v/release/ChartsCSS/charts.css?style=for-the-badge) ![Minified Size](https://img.shields.io/bundlephobia/min/charts.css?style=for-the-badge)] ![License](https://img.shields.io/github/license/ChartsCSS/charts.css?style=for-the-badge)]
4
5**Charts.css is an open source CSS framework for data visualization.**
6
7Visualization help end-users understand data. **Charts.css** help frontend developers turn data into beautiful charts and graphs using simple **CSS classes**.
8
9## Documentation
10
11Check the full documentation on [ChartsCSS.org](https://ChartsCSS.org/).
12
13* [Get Started](https://chartscss.org/docs/)
14* [Components](https://chartscss.org/components/)
15* [Charts](https://chartscss.org/charts/)
16* [Customization](https://chartscss.org/customization/)
17* [Development](https://chartscss.org/development/)
18* [Examples](https://chartscss.org/examples/)
19
20## Installation
21
22### CDN
23
24Use [jsdelivr](https://www.jsdelivr.com/package/npm/charts.css) CDN:
25
26```html
27<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/charts.css/dist/charts.min.css">
28```
29
30Or [unpkg](https://unpkg.com/browse/charts.css/) CDN:
31
32```html
33<link rel="stylesheet" href="https://unpkg.com/charts.css/dist/charts.min.css">
34```
35
36### Package Manager
37
38Install using [npm](https://www.npmjs.com/package/charts.css):
39
40```bash
41npm install charts.css
42```
43
44Or using [yarn](https://classic.yarnpkg.com/en/package/charts.css):
45
46```bash
47yarn add charts.css
48```
49
50## Usage
51
52The data is structured using semantic HTML tags and styled using CSS classes which change the visual representation displayed to the end user.
53
54```html
55<table class="charts-css [ column ] [ show-primary-axis show-4-secondary-axes ] [ data-spacing-4 reverse-data ]">
56
57 <caption> Front End Developer Salary </caption>
58
59 <thead>
60 <tr>
61 <th scope="col"> Year </th>
62 <th scope="col"> Income </th>
63 </tr>
64 </thead>
65
66 <tbody>
67 <tr>
68 <th scope="row"> 2016 </th>
69 <td style="--size: calc( 40 / 100 );"> $ 40K </td>
70 </tr>
71 <tr>
72 <th scope="row"> 2017 </th>
73 <td style="--size: calc( 60 / 100 );"> $ 60K </td>
74 </tr>
75 <tr>
76 <th scope="row"> 2018 </th>
77 <td style="--size: calc( 75 / 100 );"> $ 75K </td>
78 </tr>
79 <tr>
80 <th scope="row"> 2019 </th>
81 <td style="--size: calc( 90 / 100 );"> $ 90K </td>
82 </tr>
83 <tr>
84 <th scope="row"> 2020 </th>
85 <td style="--size: calc( 100 / 100 );"> $ 100K <br> 👑 </td>
86 </tr>
87 </tbody>
88
89</table>
90```
91
92The 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.
93
94The 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.
95
96## License
97
98Charts.css is licensed under the [MIT license](https://opensource.org/licenses/MIT).