If you are re-using that same directive for each chart, then in your template your div id isn't unique. This:
var chart = d3.select("#chart").append("div")
will append to the first div with id chart.
Instead, in your link
function find the div from the
returns the DOM elements in your template.
With your template to find the first child of the outer div should be (untested):
- Why Chart is getting appended to the existing div when using ng-repeat?
- Why are my donut charts positioned outside the container when other chart types are correctly positioned?
- Why do the d3 time range functions normalize values when using step?
- div element is getting appended outside the body
- Why the line in this D3 chart isn't properly displayed when updated?
- Maintain color mapping for Stacked/Grouped Multi-Bar Chart using NVD3 when the series count fluxuates
- D3.js line chart using the wrong keys when using general update pattern
- I am getting a strange error when using the "mousover" listener with D3.js. Any ideas?
- Why does D3 not insert elements inside the selected element, when using data().enter()?
- Using D3, I am trying to add and remove lines from a multi line chart when the legend is clicked
- How to find a div using jquery when it is appended using d3.js
- Getting TypeError when trying to sort data within a d3.csv().then() Promise object using a function outside of the then() method
- why Only one line is getting extended while using brushed() in interactive multiseries line chart
- Why isn't d3 text appearing on bar chart when using new dataset?
- Line not visible in line chart when having same value in the domain() - using D3
- Using an ordinal scale ('d3.scale.ordinal') for the x-axis in a bar chart
- Make simple bar chart using C3 with separate columns on the x axis
- why isn't the checkbox change event triggered when i do it programatically in d3js
- Why isn't the C3 Chart appearing?
- Why do the mouseenter/mouseleave events fire when entering/leaving child elements in an SVG?
- Appended text not appearing when using D3
- how to add legend to a pie chart using D3js? And how to centralise the pie chart?
- How to place text on the circle when using D3.js force layout?
- How to plot animated line chart using d3 while the data table is required to be updated every 1 second?
- When using D3.js, is there a method to automatically get the closest `key` that has data?
- d3 bar chart using rangeRoundBands - why is there outer padding?
- How to modify axis labels in d3 for a stacked bar chart when the axis labels are mapped as part of the scale's domain
- D3.js - Highlight chart elements when interacting with the legend & vice versa
More Query from same tag
- svg - get path coordinates of overlapping shape areas
- Add text in rect svg and append it to arc in donut chart
- Changing size of ticks on y axis and adding legend in D3.js
- How can I add an external group to an existing svg with d3.js?
- D3 How to filter data from multiple datasets
- how to draw a dated graph using D3.js
- padding top in bar chart
- D3 Multiple SVG Objects Following Path
- Why do transitions flicker/stutter when applied in a separate function (D3)
- html in d3.js text tag
- Normalize the Graph axes in NVD3 Line with focus chart
- How can I group data to be filtered without losing crossfilter functionality using dc.js?
- dc.js line chart is not showing anything
- What is the correct way to import and use d3 and its submodules in ES6?
- D3 events on path don't work
- Vertically align nvd3 legend
- Time scale axis ticks positions
- D3 set elements to transition in order
- D3 V4 Basic example not working
- Adding links to D3 axis labels
- Bounding box in D3.js
- D3: Accessing bound data after using .datum()
- D3.js data mapping coordinates onto a topojson map
- Customize grid lines in d3 bar chart
- Is it possible to skip nodes in D3.js tree?
- How to set default value to dc selectMenu
- Map D3.js - ogr2ogr installation