javascript - Importing data from multiple csv files in D3 -


I'm new to D3 and started working on just one project. My question is, I want to import data from 2 CSV files in D3 to use them for graph comparison. The problems I am facing are:

1. How do I import data from more than one CSV file?
2. Can I use an array for each CSV or does D3 only use a global data array? Is there any way to select a certain column to import from CSV files?

Here is an example, I want to import "oldwart" from each old file and then work with the use of 2 arrays. Is it true in D3 and how?

CSV1
Time, Old, New, Old T, New T180930,1 9 9 4,24,59
2,198039,159 94, 26.45
3,152581,194032,22,61

CSV2
Time, Old, New, Old, New T
1,184950,180435,27, 26 < Br> 2,12059 9, 12 9 409,13,13
3,165222,182133,60,54

Again sorry for the dumb question, but I Have a slight reaction. Any help would be appreciated.

You can simply call d3.csv multiple times:

  d3.csv ("csv1.csv", function (error1, data1) {d3.csv ("csv2.csv", function (error 2, data2) {// something please} );});  

For your third question, no, D3 will parse everything. Although you are not compelled to use all the data, so if you are interested in only one column, then use that data.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -