Creating Graph in React

3100 views javascript
4

I am having tough time understanding how I could create Graphs in React (this is first time I am working on it)

Can someone help me by sharing which library are you using and how would you use it to plot 3 data set which looks something like this in a single graph

This would be how my data set look.

(3) [{…}, {…}, {…}]
0:{id: "SAMPLE_#SPMJXVC_1_2", x: Array(963), y: Array(963)}
1: {id: "SAMPLE_#SPMJXVC_1_3", x: Array(964), y: Array(964)}
2: {id: "SAMPLE_#SPMJXVC_1_1", x: Array(954), y: Array(954)}

answered question

1 Answer

4

Chart.js is a very popular library for creating Javascript charts.

There is a wrapper that makes Chart.js easy to use in React: https://github.com/jerairrest/react-chartjs-2

If you don't want to use that, you can read this article for more ideas: https://www.overloop.io/blog/2018/6/19/top-5-react-chart-libraries

posted this

Have an answer?

JD

Please login first before posting an answer.