A collection of easy to use charts created in D3 for your React applications.

Overview

react-charts-d3

A collection of easy to use charts created in D3 for your React applications.

  • Area Chart
  • Bar Chart
  • Bubble Chart
  • Line Chart
  • Pie Chart
  • Scatter Chart

View chart examples

Installation

Run

yarn add react-charts-d3

And import the chart types you want

import { BarChart } from 'react-charts-d3';

Charts

Area chart

<AreaChart data={data} />

Bar chart

<BarChart data={data} />

Bubble chart

<BubbleChart data={data} />

Line chart

<LineChart data={data} />

Pie chart

<PieChart data={data} />

Scatter chart

<ScatterChart data={data} />
Full list of options for each chart is available under PROPS & METHODS in the example guide.

Data Structures

Area / Bar / Line / Scatter Charts

const data = [
  { key: 'Group 1', values: [ { x: 'A', y: 23 }, { x: 'B', y: 8 } ] },
  { key: 'Group 2', values: [ { x: 'A', y: 15 }, { x: 'B', y: 37 } ] },
];

Bubble Chart

const data = [
  { key: 'Group 1', values: [ { x: 'A', y: 23, r: 4 }, { x: 'B', y: 8, r: 19 } ] },
  { key: 'Group 2', values: [ { x: 'A', y: 15, r: 11 }, { x: 'B', y: 37, r: 21 } ] },
];

Pie Chart

const data = [
  { label: 'Group 1', value: 23 },
  { label: 'Group 2', value: 15 },
];

Changelog

Check out CHANGELOG.md

Contributing

Contributions are welcome. Check out CONTRIBUTING.md

You might also like...
⚛️ Simple, immersive & interactive charts for React

⚛️ Simple, immersive & interactive charts for React

A React library for creating animated charts visualizations based on dynamic data.
A React library for creating animated charts visualizations based on dynamic data.

react-dynamic-charts (demo) A React library for creating animated charts visualizations based on dynamic data. Install npm install --save react-dynami

React wrapper for Smoothie Charts

react-smoothie React wrapper for Smoothie Charts. Install With Yarn: yarn add react-smoothie With NPM: npm install react-smoothie --save Install from

React-based drag'n'drop pivot table with Plotly.js charts
React-based drag'n'drop pivot table with Plotly.js charts

react-pivottable react-pivottable is a React-based pivot table library with drag'n'drop functionality. It is a React port of the jQuery-based PivotTab

⚛️ Simple, immersive & interactive charts for React

Simple, immersive and interactive charts for React Enjoy this library? Try the entire TanStack! React Table, React Query, React Form Visit react-chart

Plug and play React charts

Orama [DEPRECATED] This package has been deprecated as it is no longer used by Kensho internally and we do not plan to continue maintaining it. We hop

Create beautiful JavaScript charts with one line of React

React Chartkick Create beautiful JavaScript charts with one line of React See it in action Supports Chart.js, Google Charts, and Highcharts Quick Star

Bar, Line, Area, Pie, and Donut charts in React Native
Bar, Line, Area, Pie, and Donut charts in React Native

react-native-gifted-charts The most complete library for Bar, Line, Area, Pie, and Donut charts in React Native. Allows 2D, 3D, gradient, animations a

A Simple Charts Built With React
A Simple Charts Built With React

React-charts Please change the Label manually for now from: while (counter = js

Comments
  • Y axis not showing value properly after a certain point

    Y axis not showing value properly after a certain point

    I have been using barchart and if I give some bar a value of 70. the y-axis properly shows the value in succession of 5, like 0,5,10 etc.

    but if the value increases to something like 90 it shows 7e+1, 8e+1, 9e+1 etc

    I want it to show numbers only.

    opened by zexeddw 2
  • ReferenceError: window is not defined

    ReferenceError: window is not defined

    I am trying to use react-charts-d3 in a SSR remix app (on cloudflare workers) and I get this error.

    Normally I can do somthign like this to force a graphing library to only work in browser:

    import { LineChart } from 'react-charts-d3'
    
    export default function ChartLineMine ({ data }) {
      if (typeof window === 'undefined') {
        return null
      }
      return (
        <LineChart data={data} />
      )
    }
    

    I think there must be a top-level use of window or something, because it happens even if I don't return LineChart (just importing the library.)

    opened by konsumer 0
  • Tabbular charts

    Tabbular charts

    I'm creating various reports, and each report contains a barchart in it's own tab.

    There are two issues:

    1. The legend data toggling does not work for the current chart when there are multiple tabs. For example, when I have tab1|tab2|tab3 each have their own separate barchart. I attempt to toggle key1 from the barchart in tab1, but that will toggle the key1 from tab2.
    2. The other issue is when I do toggle the keys, when I switch tabs the charts data will mix match and soon the chart from tab3 will be in tab2 and vice versa.

    When I have all these charts all on one view there are no issues, or even when i just have 1 tab. But when I have multiple tabs with each table on separate tabs the issues above occur.

    opened by Herosh123 0
Owner
Nick Turner
JavaScript Developer.
Nick Turner
A thin, typed, React wrapper over Google Charts Visualization and Charts API.

A thin, typed, React wrapper for Google Charts. Docs and examples. React Google Charts Docs and examples. Installation Quick Start

Rakan Nimer 1.4k Jan 6, 2023
EazyChart is a reactive chart library 📈, it allows you to easily add SVG charts in your React and Vue web applications.

EazyChart EazyChart is a reactive chart library, it offers the ability to easily add charts in your React and Vue web applications. The purpose of thi

Hexastack 16 Dec 15, 2022
React minimal pie chart🍰 Lightweight but versatile SVG pie/donut charts for React. < 2kB gzipped.

React minimal pie chart Lightweight React SVG pie charts, with versatile options and CSS animation included. < 2kB gzipped. ?? Demo ?? . Why? Because

Andrea Carraro 341 Dec 14, 2022
📊 📈 📉 React.js plugin for building charts using CSS

Chartify React.js plugin for building charts using CSS. Demo The source for this module is in the main repo. Example app is here. Backend service for

Kirill Stepkin 685 Jan 1, 2023
📊 📈 📉 React.js plugin for building charts using CSS

Chartify React.js plugin for building charts using CSS. Demo The source for this module is in the main repo. Example app is here. Backend service for

Kirill Stepkin 685 Jan 1, 2023
React components for building composable and flexible charts

rumble-charts React components for building composable and flexible charts to visualize your data. It's based on D3.js under the hood, but most of the

null 338 Dec 26, 2022
Modular React charts made with d3.js

Update Important update: The actively maintained fork of this project is now at the Github of react-d3 co-creator yang-wei, who has recently taken the

Eric S. Bullington 1.8k Oct 27, 2022
Customizable React-based editor panel for Plotly charts

Customizable React-based editor panel for Plotly charts

Plotly 443 Jan 1, 2023
react d3 charts

CRA-MHL A Professional Starter Create React App (CRA) with Must-Have Libraries (MHL) Template A very opinionated starter Create React App (CRA) templa

Oscar Cardoso Garcia 6 Oct 19, 2022
Reactochart is a library of React components for creating data visualization charts and graphs.

Reactochart is a library of React components for creating data visualization charts and graphs. Components include line chart, bar chart, area chart, heat maps, scatterplot, histogram, pie chart, sankey diagram, and tree map.

Spotify 530 Dec 26, 2022