# How to Graph data from csv file?

**URL:** https://discourse.processing.org/t/how-to-graph-data-from-csv-file/12388
**Category:** Libraries
**Created:** [June 29, 2019, 8:18pm UTC](https://discourse.processing.org/t/how-to-graph-data-from-csv-file/12388 "2019-06-29T20:18:34Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![RichardDL](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@RichardDL](https://discourse.processing.org/u/RichardDL)
#### Post date: [June 29, 2019, 8:18pm UTC](https://discourse.processing.org/t/how-to-graph-data-from-csv-file/12388/1 "2019-06-29T20:18:34Z")

</div>

Hi, I’ve made myself an application with a node.js server serial-connected to Arduino. The Arduino is collecting temperature data and the server sends it to a P5.js web-page and logs it to csv file. I’d like to show a graph of the csv data. In the web-page how do I ask for the file of data and get it into a table or array so I can plot it?

---

<div class="post-metadata">

### Author: ![figraham](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/figraham/32/4161_2.png) [@figraham](https://discourse.processing.org/u/figraham)
#### Post date: [June 29, 2019, 11:03pm UTC](https://discourse.processing.org/t/how-to-graph-data-from-csv-file/12388/2 "2019-06-29T23:03:00Z")

</div>

Check out [`loadTable()`](http://p5js.org/reference/#/p5/loadTable). The example shows you how to load in a .csv file. You might also have to use the [fetch api](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) if you’re csv file is on a server and not local.

Also Dan Shiffman recently made some videos about graphing using chart.js which might a quicker way to create some graphs if you don’t want to spend forever styling graphs in p5js. [Here’s a link](https://www.youtube.com/watch?v=5-ptp9tRApM&list=PLRqwX-V7Uu6YxDKpFzf_2D84p0cyk4T7X&index=6&t=0s) to that. Also the [1.2 video](https://www.youtube.com/watch?v=RfMkdvN-23o&list=PLRqwX-V7Uu6YxDKpFzf_2D84p0cyk4T7X&index=4) in that course is about parsing csv files that you get from the fetch api.

Hope that helps!

---

<div class="post-metadata">

### Author: ![RichardDL](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@RichardDL](https://discourse.processing.org/u/RichardDL)
#### Post date: [June 30, 2019, 12:19pm UTC](https://discourse.processing.org/t/how-to-graph-data-from-csv-file/12388/3 "2019-06-30T12:19:37Z")

</div>

@figraham, thanks, I have something simple working with loadTable (worked without ‘fetch api’, just coming from the server’s folder. I haven’t spent much time formatting and I have started watching the video.  
Thanks again.
