From the course: Master Next.js by Building Scalable Apps with Routing, Databases, and Performance

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Implementing chart using Recharts

Implementing chart using Recharts

In this lecture, we will learn about how we can display data in the chart form. We are going to use the recharts library which provides various types of charts like line, area, bar or pie or even combination of various charts. And we are able to customize the charts as well. This library is based on react. So we will use it in the next JS application as well. I will open the terminal and install the recharts by saying npm i recharts. All right. Now we will use the line chart in our application. So let's open the official docs. And this is how the line chart will look. To use it in the project, we are going to have a customer component that renders the chart as per the data fed in it. So let's begin. I will navigate to the components directory and create the file called custom line chart.jsx. Now let me quickly create the custom line chart component with empty fragment and export it. Now to create a line chart, we will use the line chart component and inside it, I will use the line…

Contents