score:1
Accepted answer
Is this what you're looking for?
Relevant code changes:
The whole dataset was being passed to the
getRecordContent
function. So I changed that: when hovered over "admissions", pass "transfers" and "codependents". (line: 435)var filtered_dataset = dataset.filter(function(row){return row.record !== d.record; }); for (var i = 0; i < filtered_dataset.length; i++) { content += getRecordContent(filtered_dataset[i], idx); }
Seems like you need to specify the state name as well along with the record. (line 480)
return '<li><span class="record-label">' + obj.state + ' ' + obj.record.toLowerCase() + '</span><span class="record-value">' + numFormat(obj.values[pos].y) + '</span></li>'
Edit:
Changes made for the tooltip to adapt to the main chart as well:
var filtered_dataset = dataset.filter(function(row){return row.record !== d.record && row.state === d.state; });
Changed z-index for the tooltip in main.css (try removing it and hovering close to the jquery slider)
z-index: 2;
Hope this helps. :)
Source: stackoverflow.com
Related Query
- How to remove div if its text is identical to another div?
- How to append text to a div in D3
- How to find a DOM element by its text content?
- How to prevent SVG text from flowing out of its circle?
- How to entirely remove a d3 forceSimulation and its drag handers
- How to remove svg inside a div
- How to remove D3 link text from visualization
- How to rotate text around its centroid (vertically flip) in SVG / D3?
- How to color specific parts of text div in D3?
- How does text on SVG not update but text on a div does?
- How to offset a text by half of its height to center it vertically by an angle?
- using d3.js, how can i select a particular <g> which has particular text in <text> as its child?
- How to get exact DIV size with defined maximal-width to simulate text flow in SVG?
- How can I remove or replace SVG content?
- How do I remove all children elements from a node and then apply them again with different color and size?
- How to remove an attribute in D3.js?
- How to center text in a rect element in d3?
- How to write vertical text from bottom to top without using transform rotate?
- How to set text color for my d3 chart title?
- How do you remove a handler using a d3.js selector
- How do you remove the background gridlines in nvd3.js?
- How to show full text when zoom in & truncate it when zoom out
- How to return html in d3 text function?
- D3 grouped bar chart: How to rotate the text of x axis ticks?
- how to assign unique id to SVG text element in d3 javascript
- D3js : How to convert svg text to path?
- How do you make an SVG element mouse event bubble up through another element?
- How can I dynamically resize an SVG rect based on text width?
- How to dynamically display a multiline text in D3.js?
- How to linebreak an svg text in javascript?
More Query from same tag
- How to filter a range of elements in d3js?
- Reference backbone functions from within a nested d3 function
- D3 make g element drag
- Example CSS for D3 script with R package r2d3?
- d3.scale on JSON Data
- AngularJS D3. How to append anything to existing graph (draw over it)?
- How to make d3 title on a chart responsive?
- d3.js - calculating width of a previously drawn element
- Trouble loading CSV data in D3
- d3.js world topojson v4
- Forced layout using rectangles instead of circles
- trying to get svg paths to flow smoothly
- Sliding Value Selector With D3
- d3.js - Change value for Tooltip with radio button
- Incremental scatter plot in c3.js
- D3js with element base on data
- Contamination in a graph using d3js
- D3 line chart and adding data points real time
- How to draw graphs using d3.js for a big dataset?
- Change the color of symbols in D3-legend
- Timing issue on multi-line chart?
- How can I accommodate for long computational times in d3.transition callbacks?
- What does $('') mean in JavaScript?
- Memory leak with d3.js keyed join in event handler closure
- Layout: directly D3 or with div/span in HTML?
- how to obtain a complete clockwise rotation in D3
- Referencing parent id in d3 after data()
- Flask and D3.js error - Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
- javascript = !1 : what does this mean
- How to show only filtered entries dc.js?