score:1
Accepted answer
the problem here is this line:
var layer = svg.selectall(".layer")
the first time you run changepangolin
there is no element with a class layer
, and the path is appended as expected. however, from the second time on, as there is already an element with a class named "layer" in the dom, your "enter" selection will be always empty.
solution:
append your path outside the changepangolin
function:
var layer = svg.append("path")
.attr("fill", "none")
.attr("stroke", "black")
.attr("stroke-width", "2px");;
and, inside changepangolin
, simply change it:
layer.transition(t)
.attr("d", area(newdata.data))
Source: stackoverflow.com
Related Query
- D3 radar chart data update doesn't work
- Dynamically update chart data in D3
- How to update d3.js bar chart with new data
- d3 multiline update path and transition path does not work with nested data
- How to update data in stack bar chart in D3
- D3 How to update the chart after selection from drop down menu with new data
- D3 - Update bar chart data onclick
- I want to update the data on this d3.js bar chart by clicking a button. (onclick)
- update d3 chart with new data
- D3.JS V4 update chart elements after adding/updating data
- How to update data by visually manipulating a chart
- d3 chart update automatically when data change by using vue
- how to update d3 chart when receiving new DATA
- Making a d3 chart update with new data
- How to update data in d3 chart with an onchange slider event?
- Update chart with new data not working
- How do I update my multiple line chart data in D3?
- D3 - Update chart based on data keys
- JavaScript D3 bar chart data will not update when new source is selected from drop down filter
- how to update text added in dimple.js stacked bar chart on data updation
- Update data on line chart not working
- d3js v4 can't remove old data chart after update
- d3.js radar chart with images provided in data
- d3.js can not update the chart - using json data
- d3.js update bar chart labels after sorting data
- D3 updating bar chart with new data set cause update issue
- Update pie chart data at run time
- Update data on d3 stacked bar/column chart
- d3js - How to update an existing svg path in a simple d3 line chart with new data flowing through?
- Update d3 data element after chart is drawn
More Query from same tag
- Using D3.js geom to scale a voronoi polygon with result in lat long, not coordinates in px
- d3.js : group dynamic SVG elements based on data
- d3 table - adding specific hyperlink to value
- Recover page content when visiting back
- D3 scatter plot not showing
- meteor d3.js communicate event
- D3 map: zoom to group of paths
- R viewer pane is not showing D3 interactive graphs
- Appending text to D3 force layout graph
- Customizing the tick marks in D3 LineChart
- d3.select by namespaced attribute
- SVG viewbox is ignored when composing from js
- Adding text to d3 bars
- d3js straight line color covered by other lines
- Can D3.js fetch in data using "whitespace" separated values?
- how to scale x axis to make data prettier
- How can I speed up loading thousands of images?
- The width seems to be zero (or NaN) always for an svg:text element in Firefox 15
- Horizontal bar chart index is off
- Difficulty accessing json file with d3 and flask
- D3.js .selectAll not working
- How to properly get text width to center labels above graph bars?
- SVG indicator while ajax gather all information (D3.js)
- D3 put times in X axis instead of array value
- Svg scale() is not working on Edge(Not Edge Chronium)
- Animating a continuous line horiizontally and vertically
- D3 Error: NotFoundError: Node was not found
- How do I manage groups for a grouped bar chart with a dropdown to update the chart in D3?
- D3 set elements to transition in order
- Radial stack issue