score:1
Accepted answer
I made a plunk with the code you have there and everything works just fine. Let me explain a little of what is going on though.
Instead of using HTML that is already there, D3 will often generate its own (in fact it has to generate its own to do the visualizations). You see this with statements like the following:
svg.append("path")
.attr("class", "line")
.attr("id", "blueLine")
.attr("d", valueline(data));
D3 just created a path element and appended it to the svg element it created earlier. It gives this particular element an id of blueLine
which it uses later to apply styles. It did not exist in any HTML prior to this script running. D3 created it.
Source: stackoverflow.com
Related Query
- D3 Line Chart Show/Hide Element, Variable Not Defined Error?
- D3 line chart does not show tool tip and data points properly
- C3 - line chart time series error: x is not defined for id = "Dates"
- D3.js horizontal line chart does not show tool tip properly
- D3js line chart not transitioning, Tooltip error on new bars
- d3js line chart error - drawing weird area
- nvd3.js-Line Chart with View Finder: rotate axis labels and show line values when mouse over
- C3.js SVG visualization to Canvas with canvg - Line charts filled with black rectangles , "ERROR: Element 'parsererror' not yet implemented"
- d3 v4 line chart transition not working
- How to hide and show points on a line graph
- Error in A Simple D3 Line chart with Legend and Tooltips for D3v 3.5.13
- nvd3 line chart not shown properly. (dots and shaded area)
- D3 bar chart not showing first element in array
- Hide and show svg element with transition
- D3: how to show lone point in a line chart
- Jshint: error : d3 is not defined
- Line chart not aligned with x axis
- NVD3 Line Chart doesn't display when data passed using ajax - data.map is not a function
- Nested line chart not showing up
- Multiple line chart not working with date format
- d3js - line chart `circle` placement to the lines are not properly sets
- Time series line chart is not sync with axis
- Reference Error JS not defined for Datamap
- D3 chart Y axis line is not visible in some resolutions
- Line chart not hitting the right value on chart and has a smooth line
- D3 line graph getting error and not getting plotted
- Do not show animations on C3.js Donut chart
- Single point not shown in nvd3 line chart
- d3js - my line chart is not working
- nvd3 - force all xaxis labels to show on line chart
More Query from same tag
- d3 transition with percentages using styleTween
- Uncaught TypeError: canvas.selectAll(...).data(...).enter is not a function in d3
- Working with dynamic JSON in d3.js
- d3.js and dimple.js two identical elements
- Adding tooltip and focus guides for x and y2 axis on multi-axis linechart in d3
- Collision detection for nodes of varying sizes not working as expected
- How to display stacked data correctly with an nvd3.js multiBarChart
- SOLVE: C3 - Labels not showing in C3 pie chart whit narrow arcs
- How to define custom time interval in d3.js
- How can I change the radius and opacity of a circle in d3?
- How to fix a multiple brush chart in d3
- Zoomable network graph in AngularJS
- c3js, X Axis crushed and badly formated
- Interpolate line to make a half-circle/arc in d3
- how to get drag event in d3.js in javascript?
- How to plot multiple lines one for each element of an array contains y values in vega spec data?
- Hyperlinks in this NVD3 example
- d3 time scale - last bar on graph is appearing outside of the graph
- Setting a small image on map on some coordinates using D3.js and GeoJson
- Modify link and node colours in Sankey with NetworkD3
- Why doesn't this D3 chart redraw when I repeatedly call it's original draw function?
- Data input format for heatmaps
- Time series line chart is not sync with axis
- d3 graph with limited zoom
- Using d3.js in Angular2/Node/Express/MongoDB App
- Remove event listener with d3js not working
- vuejs + dagre-d3 tooltip issue
- Right Axis not displaying on Dual Axis Grouped Bar and Line Chart D3
- D3.JS trying to format the text in first tick of axis
- Remove d3 tooltip onclick