Hafsah Emekoma Writer, frontend developer, and overall tech enthusiast.

The top 8 React chart libraries

5 min read 1644

The Top 8 React Chart Libraries

Editor’s note: This article was last updated on 6 February 2023 to add a number of popular React chart libraries, including Visx and BizCharts.

Data is everywhere and is an increasingly important part of our lives. We collect, send, and analyze data every day.

Data, in and of itself, is not visually appealing, but we can make it so. Charts make data both aesthetically pleasing and easier to understand and retain because it’s easier to engage with information when there are coordinating visuals to focus on.

When building websites or applications, there are myriad ways to display charts in your work. You may decide to build your charts from scratch or use the many available React chart libraries. In this guide, we’ll compare the top chart libraries for React applications.

Jump ahead:

Why use React chart libraries?

Chart libraries are designed to ease the process of building charts and other data visualizations. When working on small projects, it’s often simple enough to create charts from scratch. However, if you’re working on a project that requires you to display data of different types, it might be more useful to use a chart library.

In today’s React ecosystem, there are many libraries designed to help you create interactive, responsive, and even animated charts easily and efficiently.

Without further ado, let’s compare the top eight React chart libraries, evaluating each for criteria including features, documentation, community adoption, and customizability. We’ll focus on a few of the most popular and widely adopted React chart libraries.

Recharts

Recharts

With 19K stars on GitHub, Recharts is a redefined chart library built with D3 and React. One of the most popular charting libraries for React, Recharts has excellent documentation that is easy to understand, as well as great project maintainers.

Recharts follows React’s component principle by enabling users to build charts with its reusable React components. Recharts provides beautiful charts out of the box that can be customized by tweaking the existing component’s props or adding custom ones. It has drawing support for SVGs only and does not provide support for mobile. The charts are not responsive by default but can be made responsive by using a wrapper component.

Recharts has been around for a while, so it has a lot of users and a large community. You can easily get started with this chart library by using its CDN or installing it with either npm or yarn.

  • React component syntax
  • Based on D3
  • SVG support/No Canvas support
  • GitHub Stars: 19K+
  • npm downloads: 1.1M+
  • Backed by Open Source Community

react-chartjs-2

React-Chartjs-2

If you’ve used Chart.js in React, you should experience no learning curve when using react-chartjs-2. react-chartjs-2 is a React wrapper for the popular JavaScript Chart.js library. Many features of Chart.js can be used in react-chartjs-2.

react-chartjs-2 has drawing support for Canvas only and renders on the client-side. At the time of writing, it has more than 5.7K stars on GitHub.

react-chartjs-2 supports animation and most of the charts it offers are responsive by default. The library provides some components for various types of chart styles out of the box and also allows for customization.

Although react-chartjs-2 does not have detailed documentation of its own, its website shows the different chart types and how to get started with them. Additionally, Chart.js has detailed, easy-to-understand documentation.

This library performs really well across all modern browsers and also has a large community of users and great maintainers. It can be installed using npm or yarn.

  • React component syntax
  • Based on Chart.js
  • Canvas support/No SVG support
  • GitHub stars: 5.7K+
  • npm downloads: 770K+
  • Backed by Open Source Community

Victory

Victory

According to its official documentation, Victory is “an opinionated, but fully overridable, ecosystem of composable React components for building interactive data visualizations.”

Like many other React chart libraries on the list, Victory was built with React and D3. It comes with a wide variety of charts out of the box that are fully customizable.

Victory has robust, detailed documentation, which makes the library beginner-friendly and easy to get started with. It features drawing support for SVG and high-quality animations that can be customized (at least to some extent). Victory also offers responsive charts that work well across screen sizes.



The library has more than 10K stars on GitHub at the time of writing and is maintained by the developers at Formidable.

A major advantage of using Victory is that it can also be used for building iOS and Android applications. This is because Victory has a version for React Native that uses an almost identical API as the web version.

Nivo

Nivo

Nivo, like many other React chart libraries, was built with React and D3 and provides a variety of chart types and designs to choose from. The library offers HTML, Canvas, and SVG charts, provides support for client and server-side rendering, and works well with animations.

Nivo comes with a wide range of beautiful charts that can be customized if needed without much difficulty. Many of the charts Nivo provides are responsive by default, so they fit well across various screen sizes. Nivo also supports motion and transitions, which are powered by React Motion.

At the time of writing, Nivo has more than 11K GitHub stars. It boasts a thriving community and engaged maintainers and has a beautiful website with detailed documentation that makes it easy to get started. Nivo can be installed using npm or yarn.

  • React component syntax
  • Based on D3
  • SVG, Canvas, and HTML support
  • Animations powered by React Motion
  • GitHub stars: 11K
  • npm downloads: 336K+
  • Backed by Open Source Community

React-Vis

React-Vis

Created by Uber and built with React and D3, React-Vis is one of the easiest React charting libraries to get started with.

If you’ve ever worked with React components, you will find it easy to work with the components provided by React-Vis because they function in a similar way, with props, children, and callbacks.

With React-Vis, you can create various types of charts including line, bar, and pie, and more. It provides attractive, customizable charts out of the box and supports animated charts powered by React Motion.

React-Vis also has drawing support for Canvas and SVG. You don’t need deep knowledge of any data visualization library to use React-Vis; the easy-to-understand documentation is enough to get you started.

  • React component syntax
  • Based on D3
  • SVG and Canvas support
  • GitHub stars: 8K+
  • npm downloads: 1.2M+
  • Backed by Uber

ECharts

ECharts

ECharts is a charting library built by Apache. Having been built on top of ZRender, a lightweight Canvas library, it provides both SVG and Canvas support.

Besides the usual chart types, ECharts also provides a few unique chart types like Sankey diagrams, graphs, and heatmaps. Along with 200+ data visualization types, ECharts also provides a wide range of customization options and has support for themes and extensions. It also supports animation and is responsive by default. ECharts also has a large community of users and is backed by Apache.

Its extensive customization options and support for themes and extensions make ECharts a great choice for developers who want to create beautiful, informative charts with detailed data visualizations.

  • Vanilla JavaScript syntax
  • Top notch animations and aesthetics
  • Themes and extensions — Also supports light and dark themes
  • SVG and canvas support
  • GitHub stars: 54K+
  • npm downloads: 458K+
  • Backed by Apache

BizCharts

BizCharts is a data visualization library built by Alibaba. It is built on top of G2, a data visualization library built by AntV.

BizCharts provides a wide range of chart types and supports both SVG and Canvas. It also provides a wide range of customization options and has support for themes and extensions. You might not find some documentation in English, but the BizCharts library is easy to use and has a thriving community of users.

  • React component syntax
  • Based on D3
  • SVG Support/No Canvas support
  • GitHub Stars: 6K+
  • npm downloads: 23K+
  • Backed by Alibaba

Visx

Visx

Visx is a data visualization library built by Airbnb. It is built on top of D3 and provides a wide range of chart types and supports both SVG and Canvas.

Its minimalistic design makes Visx aesthetically pleasing. API is super customizable and allows you to build your own charting library on top of it.

Visx also has a strong focus on performance and keeps bundle size small. It works well with CSS-in-JS libraries like styled-components and emotion.

  • React component syntax
  • Based on D3
  • SVG support/No Canvas support
  • GitHub stars: 16K+
  • npm downloads: 295K+
  • Backed by Airbnb

Conclusion

There are more charting libraries available for React than we can examine in a single article, but the few libraries described above are among the most widely adopted and beloved in the React community.

Here is a quick recap of adoption and popularity of the libraries mentioned above:

Library Stars Downloads Rendering Backed by
Recharts 9k+ 1.5m+ SVG Open Source Community
react-chartjs-2 8k+ 773k+ Canvas Open Source Community
Victory 10k+ 175k+ SVG Formidable Labs
Nivo 11k+ 336k+ SVG, Canvas Open Source Community
React-Vis 8k+ 98km+ SVG, Canvas Uber
E-Charts 54k+ 458k+ SVG, Canvas Apache
BizCharts 6k 23k+ SVG Alibaba
Visx 16k+ 295k+ SVG Airbnb

When deciding on a chart library to use for your React project, remember that they were all created to help developers achieve a particular end result. Compare their functions and what they offer before deciding which is best for your project. Some chart libraries might be ideal for smaller projects, while others are better suited to more complex projects.

Ultimately, the choice of what React chart library to use depends on your project requirements and what types of features you prefer to work with.

LogRocket: Full visibility into your production React apps

Debugging React applications can be difficult, especially when users experience issues that are hard to reproduce. If you’re interested in monitoring and tracking Redux state, automatically surfacing JavaScript errors, and tracking slow network requests and component load time, try LogRocket.

LogRocket combines session replay, product analytics, and error tracking – empowering software teams to create the ideal web and mobile product experience. What does that mean for you?

Instead of guessing why errors happen, or asking users for screenshots and log dumps, LogRocket lets you replay problems as if they happened in your own browser to quickly understand what went wrong.

No more noisy alerting. Smart error tracking lets you triage and categorize issues, then learns from this. Get notified of impactful user issues, not false positives. Less alerts, way more useful signal.

The LogRocket Redux middleware package adds an extra layer of visibility into your user sessions. LogRocket logs all actions and state from your Redux stores.

Modernize how you debug your React apps — .

Hafsah Emekoma Writer, frontend developer, and overall tech enthusiast.

2 Replies to “The top 8 React chart libraries”

  1. Recharts provides support for mobile (with responsive container). But the docs page was not made for mobile, that’s for sure 🙂

Leave a Reply