score:0
i just glanced at the code on the page you referenced the working example at and think i figured out the issue.
here's the line that taking out the ticks from the legend svg
:
d3.selectall("text").remove();
which is a part of the onchange
function for $("#stateselect")
.
line number: 279 to be more specific (in index.html file)
i think you want to take out all the texts from the mainsvg i.e. with the id: svgmap2
.
changing the above selection will fix the issue. (for eg. if you have a class for the texts to be removed, use d3.selectall('text.<classname>')
.
hope this helps.
score:0
i figured out why it's "disappearing". the web is a stateless medium. so, every time i changed selection from the dropdownlist, the svg refreshes and losses its current state. so i needed to re-create my legend for the state and county dropdownlists. but also, for the county dropdownlist, since there is a zoom function, it meant that everytime i zoom to another county, i loss my map state again. so i moved the recreate legend function into the zoomedin method (that is, after the zoom state). it works now.
Source: stackoverflow.com
Related Query
- D3.js: Why are my legend tick marks' text disappearing?
- Why are some of the grid lines randomly disappearing on my responsive D3 chart?
- D3 time axis - why do tick marks seem to be invisible by default?
- Why my rotated tick values are not getting displayed completely d3js?
- Why are the first two text labels of my bar chart not shown?
- Why are not all my text labels showing in my Scatterplot?
- Why dont the axis tick marks get removed?
- Why are the text labels in d3 transforming to zero on pan/zoom?
- Why are my SVG foreign object text not showing up?
- How to add tick marks to color legend in d3.js
- NVD3 chart fails to calculate legend text length in Chrome, since Window.getComputedStyle does not return font-size correctly
- d3 tick marks on integers only
- Why are d3's select() and selectAll() behaving differently here?
- How can I keep tick marks from repeating when I have a small number of dates on an nvd3 chart
- Tick marks on both sides of axis on d3 scale
- Why are .domain, tickFormat and tickValues not recognised inside dimensions variable? (d3, parallel coordinates)
- D3.js time scale tick marks - Years and months only - Custom time format
- How to avoid the overlapping of text elements on the TreeMap when child elements are opened in D3.js?
- Why are programmatically inserted SVG <tspan> elements not drawn, except with d3.js?
- Count number of tick marks in D3.js
- Looping through data attributes to create 4 separate bar charts... why are there "phantom" data elements being bound to the xAxis?
- How do I hide the text labels in d3 when the nodes are too small?
- How do I specify the number of axis tick marks in d3?
- Why are cross-origin Image requests blocked by Cytoscape.js but not by d3.js?
- D3: How to remove tick marks at the top and bottom of Y axis
- NVD3 line chart - legend text cut off
- Why are my images not showing up in the nodes of this D3 chart?
- Changing size of D3 tick marks based on tick value
- d3.js: Dual lines of text for each tick on an axis?
- Why are these Cubism horizon charts squished to the left?
More Query from same tag
- d3.js: How to populate cells with color for blank values?
- Transitioning circles, one by one
- d3js tree.nodes() is not a function
- Responsive D3 Bar chart appending new <text> when resizing
- d3 force directed graph, focus on node double click
- Ragged list or data frame to JSON
- How to remove extras lines using stylesheet from axies in the D3.js
- Angular Reload D3 Chart Directive after event
- Clear the interval in d3.js
- High performances to interact with 10.000 objects
- Stop div's childNodes from responding to div's event listener
- How to show rating using row chart in dc js
- Plotting IP addresses on axis
- D3js data format
- Disable brush on range chart before selecting a scale from the dropdown/on page load(dc.js,d3.js)
- Very Simple D3: How to Draw an Arc?
- Diagonal Cut on a text on the path of a svg line
- How to use d3.js Hierarchy with custom data structure?
- Mouse event handling in a node and its children
- converting numbers on y axis to string with K for thousand d3.js
- Creating D3 nested JSON Data with Python
- Why does the mouseover method don't work on node's text in a dialog?
- d3.js: Nested Selection with update using `join`
- Place label beside links on collapsible d3 tree layout
- How to let the line fit into the axis
- Right-justifying an HTML table created in D3
- Values from file don't expand as x axis in D3.js using x.domain?
- D3 Force Layout: How to dynamically orient teardrop-shaped nodes?
- D3 Treemap v3 to v4
- D3 - Stacked bar update, axis update but not bars