I second @TomShanley answer but you should not be using the enter
.data[[data]] as you are not using the data itself. You should instead just add
svg elements using d3. Later on you can add the data as needed to create the circles.
You should also not have
<svg> elements inside
<g> or others
Here is the updated fiddle:https://jsfiddle.net/mghays6a/1/
The enter selection that you are using for the circles, is based off the append for the line that uses
.data([data]). While this is OK for lines/paths (as you want one element), this won't work when you want separate elements per datum.
You should do a separate
selectAll("circle").data(data).enter()...etc, where the data is not in the square brackets. This will give you separate elements for each circle.
- Adding Data Label and Marker to the Line chart using d3
- How to plot animated line chart using d3 while the data table is required to be updated every 1 second?
- d3 adding circles on the highest and lowest value on line chart
- Adding data label in D3 Line chart (for Power BI)
- Time in x-axis and data for the y-axis for line chart in d3.js doesn't match/show with what (data) is on JSON
- Using D3, I am trying to add and remove lines from a multi line chart when the legend is clicked
- D3 line chart and adding data points real time
- filter the json data and draw the nvd3 chart using filtered data
- Is there a function to find the approximate x and y co-ordinate values on a line chart using D3.js?
- D3.js Draw vertical line after every 2 bar and draw x-axis label on the top of bar chart
- Real time data graphing on a line chart with the help of rickshaw and d3.js
- Line chart using ordinal x-axis with d3.js and nvd3.js
- how to add legend to a pie chart using D3js? And how to centralise the pie chart?
- D3.js: plot dots on the existing line in a multiseries line chart with long formatted data
- d3js gantt chart with date/time scale at the top and current day blue line
- Adding background color in d3 js bar chart using data values
- NVD3 Line Chart doesn't display when data passed using ajax - data.map is not a function
- Create a padding for the first and last data points using a time scale
- Placing elements on circle line and rotating them towards the center using D3.js
- Sorting the bars and getting the group data in a grouped bar chart
- D3 line chart does not show tool tip and data points properly
- d3 line chart using a sorted data set
- Create synchronous loading of data using D3.js and drawing following the loading
- Line chart not hitting the right value on chart and has a smooth line
- Multi line chart using d3 and json in a nvd3 structure
- How do you get JSON data and create a line chart with d3.js?
- D3.js line chart using the wrong keys when using general update pattern
- Why doesn't the same group render a correct line chart and corresponding range chart?
- How do you add multiple lines to a D3JS line chart where the depedent variable data sources start at different positions along the range?
More Query from same tag
- Ordinal scatterplot in D3
- D3 bar chart update
- D3.js Force Layout: Dynamically added node doesn't move with rest of graph
- What is this event handler doing?
- How to assign alternative depth values only to the child nodes in d3js?
- Focus on form field after animation
- Create hierarchy from row data
- Mouseover is not working in d3.js by attaching it to circles
- How to use Meteor and D3 to draw circles?
- D3 Display elements of inner list on tool tip as different lines
- d3.geo.path() to draw multiple routes on a map
- Build D3js Area Chart with negative values
- d3 mouse event: using selection.node()
- d3 donut/pie chart - drawing a line between arcs
- Update text in sunburst bilevel partition
- how to capture node name upon mouse hover in a shiny network graph?
- How to transition (rotate) individual letters of a sentence for major browsers (also Chrome)
- D3, Scale How to set the scale?
- Using 1 as minimum value for a Radar Chart
- add a new rccord to parallel coordinate chart in d3
- Rotating teardrop shape in SVG around axis point
- Collapsible Sankey Diagram - D3
- D3: Zoom with multiple line charts somehow combines their data arrays
- Find nearest keyframe using scales
- d3.js : changing axis text label with glyphicon
- Multi line labels in c3 charts
- Interpreting (and getting beyond) cryptic console output
- How to return Neo4j OGM entities in GraphJSON format instead of tree format for visualization?