In your code, this...
div.innerHTML += 'Primary substance use among TEDS aged 12 years and older, by gender, age, race, and ethnicity: ' + selectedState;
...is just concatenating any previous text in that
<div> with the new text.
Instead of that, just assign a new value:
div.innerHTML = 'Primary substance use among TEDS aged 12 years and older, by gender, age, race, and ethnicity: ' + selectedState;
Here is the updated Plunker: http://plnkr.co/edit/qCk4iu51SAtHJ3LzTB27?p=preview
- Updated table title is appended to previous one, rather than replacing it
- When creating an HTML table with D3, use certain data for a row class rather than cell
- Edit the data in a pie chart rather than create a new one
- D3 in Meteor is creating new shapes with updated data, rather than updating existing shape
- First element in data getting rerendered rather than updated
- d3.js updated rect keeps previous one
- Change hover over of d3.js sunburst chart so that name of segment is appended rather than %
- Height transitions go from top down, rather than from bottom up in D3
- How to load data from an internal JSON array rather than from an external resource / file for a collapsible tree in d3.js?
- How can I perform this d3.js magic (Grouped Bar Chart) with JSON rather than CSV?
- Hitting browser "back" button shows JSON rather than HTML (using Rails & d3.js)
- D3.geo : Spherical arcs rather than straight lines for parallels?
- Giving an element more than one event handler by selecting it using different selectors
- How to plot animated line chart using d3 while the data table is required to be updated every 1 second?
- D3 Linking nodes based on names rather than index
- D3.js: Don't start new transition until the previous one has finished?
- D3js include more than one style
- d3.js set with attribute in percent rather than pixels
- reading d3 data in from a file rather than hard coding it into a programme
- drag circle area rather than border
- D3 v3 zoom/drag performance better with right mouse rather than left?
- Identifying columns by position rather than name
- D3: replacing anonymous function with a named one
- Using consecutive D3.html() methods to concatenate html; rather than replace
- d3.js: How to deal with svg elements that are being appended on the same position, one on top of the other?
- Appended text is not updated according to CSV file changes
- dc.js x-axis displaying as decimal rather than whole number
- D3 JSON file with source and index as strings rather than indices
- Drawing a radial tree from node and edges rather than children
- D3.js: range rather than point time axis labels
More Query from same tag
- Sankey Diagram (D3) - How to use multiple units for link values and how to add notes to mouseover popup box?
- D3 Change color and scale based on radio button
- How to create a heatmap with numbers using Leaflet map?
- Moving scatter plot circles with context zooming and brush in D3
- D3 V4 ticks line x1 value
- how to use dimensions with d3 parcoords
- D3.js Visualization - how to add Y axis gridlines
- create drill down radar/spider chart with d3.js
- D3js data selection
- Nest data containing arrays with d3.nest
- Incorrect color selection of regions in the map
- Remove end-ticks from D3.js axis
- Background image not applying to one div on Chrome for Mac
- Two data sets one component , ngx-charts , angular 2
- venn.js selecting Set[A] except Set[B]
- D3 Tree Search using Input - Search on Lower Case
- Publishing interactive scientific results in Python
- How to convert GIS rasters into vector polygons?
- How to select right chart for your data
- Tooltips with canvas networks
- Synchronizing multiple graphs using nvd3
- I want to increase the width of the breadcrumbs of polygon on sequence sunburst chart on d3js
- Update d3 chart
- D3.js time scale tick marks - Years and months only - Custom time format
- How to export Victory Chart to png?
- d3.js Stacked Area chart - not appearing
- Error while converting d3 heatmap from version 3 to version 5
- how to change x-axis length of dimple chart
- D3: Selecting a specific node from a different chart
- How to create the circumference simultaneously by defining the radius in SVG?