1 | # React Google Charts
|
2 |
|
3 | <img align="right" alt="Logo" src="../../apps/docs/static/img/logo-v2.svg">
|
4 |
|
5 | React Google Charts is a lightweight and fully typed React wrapper for [Google Charts](https://developers.google.com/chart/interactive/docs/reference).
|
6 |
|
7 | It's easy to use, supports over 25 chart types, supports animations and is highly customizable when needed.
|
8 |
|
9 | [![version](https://img.shields.io/npm/v/react-google-charts.svg)](https://www.npmjs.com/package/react-google-charts)
|
10 | [![downloads](https://img.shields.io/npm/dm/react-google-charts.svg)](https://www.npmjs.com/package/react-google-charts)
|
11 | [![license](https://shields.io/badge/license-MIT-green)](http://opensource.org/licenses/MIT)
|
12 | [![bundle size](https://img.shields.io/bundlephobia/minzip/react-google-charts.svg)](https://bundlephobia.com/result?p=react-google-charts)
|
13 | ![TypeScript](https://img.shields.io/badge/TypeScript-007ACC)
|
14 |
|
15 | <br />
|
16 | <a href="https://www.react-google-charts.com/">Docs</a>
|
17 | <span> • </span>
|
18 | <a href="https://www.react-google-charts.com/docs/quick-walkthrough">Quickstart</a>
|
19 | <span> • </span>
|
20 | <a href="https://www.react-google-charts.com/examples">Examples</a>
|
21 | <span> • </span>
|
22 | <a href="#contributing">Contributing</a>
|
23 | <span> • </span>
|
24 | <a href="https://stackoverflow.com/questions/tagged/react-google-charts">Stack Overflow</a>
|
25 | <span> • </span>
|
26 | <a href="https://discord.gg/nNa2EEgUkS">Discord</a>
|
27 | <br />
|
28 | <hr />
|
29 |
|
30 | [![Visit Our Website](https://img.shields.io/badge/Visit-Website-green?style=for-the-badge)](https://react-google-charts.com)
|
31 |
|
32 | ## Quickstart
|
33 |
|
34 | Install this library with your favorite package manager:
|
35 |
|
36 | ```bash
|
37 | npm i react-google-charts
|
38 | ```
|
39 |
|
40 | Then, import and use it:
|
41 |
|
42 | ```jsx
|
43 | import { Chart } from "react-google-charts";
|
44 |
|
45 | <Chart
|
46 | chartType="ScatterChart"
|
47 | data={[
|
48 | ["Age", "Weight"],
|
49 | [4, 5.5],
|
50 | [8, 12],
|
51 | ]}
|
52 | width="100%"
|
53 | height="400px"
|
54 | legendToggle
|
55 | />;
|
56 | ```
|
57 |
|
58 | ## Contributing
|
59 |
|
60 | Contributions are very welcome. Check out [CONTRIBUTING.md](CONTRIBUTING.md)
|
61 |
|
62 | ## Run the Storybook
|
63 |
|
64 | ```bash
|
65 | git clone https://www.github.com/rakannimer/react-google-charts
|
66 | cd react-google-charts
|
67 | npm i
|
68 | npm run start:storybook
|
69 | ```
|