score:1
You can add a translate
to each individual path, just translate them by a different amount of y
to separate them from each other.
An example can be found at this fork of your code.
As you loop through the groups, you are already adding a path for each group. You can just add another attribute: .attr('transform', 'translate(0, ' + yTranslate + ')')
and then increment yTranslate
by a distance of your choice (e.g. 50
) for each group.
If you prefer, you could also make the amount of y-translation a property of the group, and set it up in the group definition earlier. This would be similar to how you specify the color
.
Source: stackoverflow.com
Related Query
- How can I put a space between the lines of a line chart using d3.js
- how i can put more lines in Line Plus Bar Chart using nvd3.js?
- How to plot animated line chart using d3 while the data table is required to be updated every 1 second?
- How can we add the space between bars for multiple groups of bars in c3js?
- how can i get a label on my lines in a line graph using d3.js
- how to start drawing a line with a space between y-axis and it using d3js
- How can I draw a continuous line using d3 without needing to click&drag the mouse, but rather just use the mouseover event?
- How to toggle lines in a line chart using a legend
- How do you add multiple lines to a D3JS line chart where the depedent variable data sources start at different positions along the range?
- How Can I display dates on the x-axis using nvd3 line charts
- How can i set the tick text of x-axis between bar in a bar chart in c3.js or d3.js?
- How do i plot multiple lines in the same line graph using the D3 framework?
- Using D3, I am trying to add and remove lines from a multi line chart when the legend is clicked
- How can I put circles at each point of the x and y coordinate of my line chart?
- How can I draw chart between 2 categories (strings) using recharts library
- how do I set up a grouping query on the server side. I want set up the query so I can use it for a pie chart in front end, using d3js
- How can I change the white space between spans when adding them programmatically?
- How to control the space between the start of a bar and the axis in a bar-chart constructed using d3?
- How can I program a line chart using D3.js to visualise a data which is received from a server side ?
- How can I use d3.layout.stack with this code to draw a line chart using D3.js?
- How to change the scale of axes in line chart using d3.js?
- How can I position rotated x-axis labels on column chart using nvd3?
- MultiBar chart with nvd3 / d3 only shows labels for every other tick on the x-axis. How can I get them all to show up?
- How can I set the each line color or width in SVG path
- D3.js - How can I add a new line to the text in this Collapsible Tree?
- How to make curved lines to straight lines for Hierarchy Chart using d3.js
- how to add legend to a pie chart using D3js? And how to centralise the pie chart?
- How can I achieve the R kernel density estimate plot using D3.js?
- How can I remove a line from the 110m TopoJson world map?
- How can i get the startAngle and endAngle of each arc in the sunburst example using d3.js?
More Query from same tag
- Do I add eventListener to every SVG element if I follow normal D3 way?
- Using Other Data Sources for cubism.js
- d3 scale.linear(): pass data as parameter
- How to apply a filter and mesh to a D3 Choropleth
- D3 tick with background
- d3 startAngle is NaN, endAngle is NaN which throws error
- d3: hovering over words in text at the same time highlighting the corresponding bars and make word in text clickable
- How can I use d3.layout.stack with this code to draw a line chart using D3.js?
- Fetch d3.js array from a url
- Load csv file in d3.js using absolute path
- Highcharts align multiple piecharts
- get percentage when using graphviz and d3 to generate pie DAG
- Responsive D3 Charts in React: ResizeObserver or the viewBox attribute?
- D3 update values to a new dataset on mouse click
- Rickshaw only show gridlines on some points
- Cannot add tooltip to zoomable scatterplot in d3 v4
- Dom-to-image SVG image elements
- NVD3 Line Chart Uncaught TypeError: Cannot read property 'x' of undefined
- Adding drop shadow effects in d3.js circle
- Using D3.js with a javascript object instead of an external JSON file
- D3.js not defined, express serving up static files
- Adding Grid to D3.js Line Chart
- D3.js - Appending to <div> not working
- Adding a correctly sized rectangle behind text
- Angular 6 compile template runtime
- d3.js: how to conditionally render a curve?
- How to draw Circles in an Arc?
- Adding svg:circle elements to a d3.js line
- d3js removing a transition of an element
- Adding a node to d3 network error (with fiddle example)