If I read your question correctly I think I could summarise it by saying that you have the data in a JSON format, but you want to use it in a csv format.
If this is correct, you could approach the problem in a slightly different way and have your data file external to the main script and then when you read the data in you could use
d3.csv depending on the format. The example here uses an external csv file.
EDIT: Here is an example on bl.ocks.org using your code and an external csv file http://bl.ocks.org/d3noob/d5ecdbefb7cc43a48f59
- D3 Multi Series Line chart not working with correct xAxis values
- d3: Multi-Series Line Chart with associative array
- D3 Multi Series Line Chart with Clickable Legend
- D3 Multi Series Line chart with non time x axis
- dc.js Series Chart multi line
- Draw D3 Simple Line chart With an Array
- Multi series chart (D3) with missing values
- Dimple.js line chart with composite axis, no links between points on series
- d3: tooltips on multi series line chart at each line when mouse hover event
- simple multi line chart with D3
- Bar chart with d3.js and an associative array
- Time series line chart is not sync with axis
- How to create a multi-series line chart with series for each unique item in 1st column?
- Charting a D3 line chart with an array of objects
- D3 Multi Line Chart Not Displaying Properly With X Axis Value
- Error displaying dots on a multi series line - dots chart
- dc.js multi line series chart filtering
- How to draw a multi line series graph using d3.js with json data using angular directives
- D3 V4 Multi series line chart: Adding data points to lines with same color as lines
- d3.js - Multi series line chart tool tip issue
- Animated Path multi series line chart in D3.Js
- d3.js multi line chart with brush
- d3.js creating a simple line chart with array of DateTime and int
- Show labels conditionally on multi series line chart
- d3 Multi Series Chart with Incorrect Values
- D3 Multi Series Line Chart
- On common x-axis how to draw a chart with different unit of dataset array (multi line chart)
- Issue with d3 Multi Line Chart
- X axis not displaying on Multi Series Line Chart using d3.js
More Query from same tag
- Translating EmberJS D3-Charts to AngularJS
- D3.js update leaves duplicate svg elements
- How to get only those data which have particular code in crossfilter
- Return value from d3 angular directive to controller
- Highlight text event d3.js
- How do I use D3js in Wordpress?
- Error while merging 'double click' code with old d3 'rebind' substitute
- Format linear scale large number replace G to B
- Replacing one d3 visualisation with another d3 visualisation in same place?
- Replacing text instead of appending in d3 & Jquery
- d3: difference between sort and ascending
- D3: Are "parabolic" scales possible?
- Getting TypeError: .selectAll(...).enter is not a function with d3.js
- Accessing properties of SVGs made using D3
- How to recursively toggle nodes in a d3.js tree diagram
- D3 : get value from the array
- In D3, how can I support both Pan&Zoom and Mouseover on a force directed graph?
- D3.js: create a fixed number of elements
- Parse filtered data with D3
- d3 stacked bar chart issue
- d3.js sankey diagram: where does ".dy" and .dx" get set?
- render svg from d3.js on non-svg supported browsers, especially IE 8?
- TypeScript Compiler: @types/d3-tip - Cannot invoke an expression whose type lacks a call signature
- d3 lat/long points are not lining up with map
- How can I detect double click on brush object?
- D3.js animation
- Attribute cy returning expected length error in D3 V4
- Is there a way to use patterns/textures using addSVG for jsPDF?
- couchbase data replication elasticsearch
- Adding a Background to certain part of a graphic with nvd3