React Google Charts screenshot

React Google Charts

Author Avatar Theme by Rakannimer
Updated: 28 Mar 2025
1675 Stars

A thin, typed, React wrapper over Google Charts Visualization and Charts API.

Overview

React Google Charts is a thin, typed, React wrapper for Google Charts. It allows developers to easily integrate Google Charts into their React applications, enabling visualization of data in a visually appealing manner. The library provides a quick start guide, detailed documentation, a range of components, examples, and even a step-by-step tutorial for creating dashboards.

Features

  • Thin Wrapper: Provides a lightweight wrapper for Google Charts within React applications.
  • Typed: Ensures type safety for React components, enhancing development efficiency.
  • Quick Start Guide: Offers an easy installation process and quick integration steps.
  • Components: Includes various components for displaying different types of charts.
  • Examples: Provides numerous examples to help users understand the implementation of charts.
  • Step-by-Step Tutorial: A comprehensive tutorial for creating dashboards using the library.
  • Contributions: Welcomes contributions from the community to enhance and improve the library.
  • Storybook: Allows users to run the Storybook for interactive visual development.

Installation

To install React Google Charts, you can use your preferred package manager, such as npm or yarn. Here is a basic guide to installing the library:

npm install react-google-charts

Or with yarn:

yarn add react-google-charts

Once installed, you can import and start using it in your React components:

import { Chart } from 'react-google-charts';

function App() {
    return (
        <div>
            <Chart
                width={'500px'}
                height={'300px'}
                chartType="Bar"
                loader={<div>Loading Chart...</div>}
                data={[
                    ['City', 'Population'],
                    ['New York City, NY', 8175000],
                    ['Los Angeles, CA', 3792000],
                    ['Chicago, IL', 2695000],
                    ['Houston, TX', 2099000],
                ]}
                options={{/*
                    chart: {
                        title: 'Population of Largest U.S. Cities',
                        subtitle: 'Based on most recent data',
                    },
                */}}
                rootProps={{/* 'data-testid': '1' */}}
            />
        </div>
    );
}

Summary

React Google Charts is a valuable tool for developers looking to incorporate Google Charts into their React applications efficiently. With its lightweight wrapper, type safety, extensive documentation, and various components, it simplifies the process of creating visually appealing charts. Additionally, the availability of examples, tutorials, and the option for community contributions make it a robust choice for data visualization needs in React projects.