score:0
Accepted answer
the answer on this question helped me to solve my problem:
since .select()
propagate the data to the selected elements, i just have to get rid of the selection:
var daterect = d3.select(this)
.append("rect")
.attr('height', desiredheight)
.attr('width', desiredwidthfromticktotick)
.attr('x', offsettolastrectingroup);
group.append(function() {
return daterect.node();
});
Source: stackoverflow.com
Related Query
- d3.js : group dynamic SVG elements based on data
- How to rearrange the DOM order of svg elements based on their data values in a dynamically changing d3 vis?
- d3.js appending different SVG elements based on a data value
- D3: update data with multiple elements in a group
- How to move elements along with svg group
- How to create SVG elements of different types based on data?
- In D3, how can I create multiple elements for each data element based on value in data?
- Get attributes of existing SVG elements and bind as data with d3.js
- A more elegant way to bind new elements using data bound to multiple group elements
- Group array elements based on value and get median of other value
- D3 - reordering elements based on their data
- Scaling a SVG rectangle position based on data
- Dynamically create rect inside svg based on data
- Determining different elements in a d3.js SVG group on drop
- Updating only those SVG elements where the underlying bound data has been modified
- Dynamic legend based on data
- d3js - Add elements based only on nested data
- How to group svg elements
- Dynamically set the width and height of SVG based on data
- How to determine a SVG shape based off of data using d3.js
- Conditional fill on multiple svg based on data
- D3 - Appending SVG based on JSON Data
- How to drag drop elements into svg group
- How can I make 2 different elements in a SVG group have different drag behaviours?
- How to clone a group of elements in svg and show the clone in specified coordinate?
- How can i group elements that are bound to different data (to be used with forcesimulatoin) in D3 so that I can sort them
- d3 drag multiple text elements inside a group SVG
- Binding data to existing number of elements based on object property
- Selection of elements based on data
- Get svg elements specific to a group using selectAll
More Query from same tag
- express svg image element rendering issue in safari/firefox
- Add different images for nodes in d3 v4 network graph
- D3 how to find the height of the last point in a line graph
- Cannot read property 'pack' of undefined
- D3 - partly force directed graph
- How to read geojson file using TopoJSON
- Using d3 transitions causes memory leak
- x-axis labels not displaying fully
- How increase height dynamically by fixing width of the rect box in d3 js
- D3 selection.append("image") from a cached response
- D3 .rangeBands() returning NaN
- Check if column is already sorted
- Add new path to an existing map in D3
- dc.js geochoropleth map scaling
- My D3.js code is not showing seconds in the time axis?
- Angular D3 bar chart animation
- How to add text alternative for external images in SVG?
- How to use d3 rotate?
- Fail to parse/project coordinates onto JSON
- show the bottom most tick of y axis
- d3.js equivalent to $(this)
- d3 scale: How to use .copy()?
- In d3.js, how can I check if an element has been removed without doing a new selection?
- Adding string field to the data array so as to obtain the string on mouse-hover.
- How to center nodes without using centering force?
- Moving HTML controls from one page to other
- D3.js Focus+Context via Brushing Barchart - Recalculate BarWidth on Brushing
- Counting data items in d3.js
- Disable "next" button when no more data available
- Unable to use this.set() for 'hoveredLabel' in D3 Bar Chart