score:1
Accepted answer
if you already have the string, you can just split it like this:
var a = "1,2,3"
var b = a.split(",")
console.log(b[1])
specifically, for your example, you can extract the data like this:
var data = jslines.map(function(l) {
data = l.split(",");
return({time: data[0], rx: data[1], tx: data[2]});
})
and then construct your d3 plot based on the resulting array of objects.
Source: stackoverflow.com
Related Query
- How can I parse csv data from a javascript array of strings for use in d3 graphs
- How to select elements from array field in dc.js / crossfilter / d3 and use each of them as separate data point for chart?
- How to load data from an internal JSON array rather than from an external resource / file for a collapsible tree in d3.js?
- How can I use D3.js to take an array of Javascript objects use them in a line graph?
- how to get data with tsv or csv to array in d3.js from a txt file?
- How do I convert strings from csv in d3.js and be able to use them as a dataset?
- How to reshaping Data in Javascript from array to object without losing some of the data
- How can I use CSV data in a zoomable sunburst chart?
- Javascript - Can not access array elements of an array created from a csv file
- how to convert data selected from a postgres database to json or csv to use it with d3js lib?
- How can D3js pack layout use data join by key for updates?
- In Meteor, how can I import data from a .tsv file to use in a d3.js chart?
- Create an array from csv for use with D3.js library
- How to pull information from a CSV file for use in a stacked bar chart
- How can i use the data from Hbase to visualize using d3.js
- How do I retrieve an array from a csv file in javascript using d3?
- In d3js, how to plot line chart from csv file, taking data from seperate columns for each row
- How can I use my data from a JSON string to populate dimple d3.js line chart?
- How to read data generated from REST API in a Javascript file and use it another?
- How to load data from a CSV file in D3 v5
- How to get maximum value from an array of objects to use in d3.scale.linear().domain()
- Select data from a CSV before loading it with javascript (d3 library)
- How can I get "call" to execute for each data element in D3?
- How to update elements of an HTML that the elements are created using data from a CSV file?
- Using Javascript D3 library, how can I determine mouse position in data set of an area element on mousemove event?
- How can we create an onclick event for a d3 data map?
- Copy data from csv into array in D3
- How to map data such that I can use it to generate pie chart?
- In D3, how can I create multiple elements for each data element based on value in data?
- How can I efficiently convert data from string to int within a d3 method chain?
More Query from same tag
- Console says cannot find a variable
- D3.js How to create just 1 element that is binded to a dataset of multiple data items
- Sankey diagram using d3.js - Add information to link title
- Place image at location with Planetary.js
- How to handle large dataset in d3js
- Zoom to arbitrary feature in D3 canvas
- custom html boxes in tree layout with d3.js
- d3 with bootstrap tooltip: titles not working with data updating
- D3.js multiple y-Axis with same position of ticks?
- Adding borders to d3 curves
- Redraw function on dropdown change with javascript
- Position relative is not working in Safari 11 Dagre-d3 svg
- D3 time and date histogram
- Is it possible to add zoom and tooltip on the same line chart in d3js?
- Retrieve value of a title tag
- d3.js v4 nest to hierarchy - Unable to read value
- D3.js with Turf.js error: "Uncaught (in promise) Error: Each LinearRing of a Polygon must have 4 or more Positions."
- d3js Text Transition I example with v3 library
- Multi donut graph with curved borders
- D3.js utcParse() returns null
- Different shapes according to data in D3 force layout
- d3 - rendering an html table on top of an svg element
- CSS transform-origin not working for svg in safari
- Manipulating Bars
- d3 refactored pie chart animations failing
- Data on x-axis is one day off (data for May 24 is showing up as May 23, etc etc) (d3, nvd3)
- D3.js - exit() section does not remove all data
- D3.js: Uniformly spaced bars on time scale
- Cannot read property 'pack' of undefined
- Javascript object sort and slice