score:1
Accepted answer
Add an onclick event which passes clicked bar reference to the function which loads html.
.on('click', function(d) {loadHtml(d)});
Then create a loadHtml function
function loadHtml(clickedBar)
{
if (clickedBar[0] = "foo")
{
$('#DivForLoadingHtml').load("http://mydomain.xyz/foo.htm");
}
if (clickedBar[0] = "bar")
{
$('#DivForLoadingHtml').load("http://mydomain.xyz/bar.htm");
}
}
Source: stackoverflow.com
Related Query
- d3 trying to open html in div or iframe on click
- Open div on mouse position on click of svg text in d3
- Open html on click using data
- d3, html in svg, animating opacity takes div out of position, why?
- Trying to append a click function to the node text in d3
- Convert HTML Div to PDF via jsPDF that has SVG
- Cannot click div when it overlays clickable d3 elements
- d3.js click event show/hide html element
- How to open D3.js Context Menu on left click instead of Right click
- Centering an HTML div overlay on an SVG chart
- Positioning multiple SVG elements in div HTML
- Unable to open the HTML file on the remote machine on my local machine
- Reference a div from d3 inside a iframe
- Click outside of Div to close it. SVG & D3, Angular
- d3 append copy of g element on click to separate div
- How to make a HTML div draggable using d3
- Display values of variables taken from div html by means of d3.js
- Open all Children at once under a parent on click in D3 Js Vertical Tree
- local host to open html file
- On button click open a new window and draw multiple large circles with D3
- Include D3 chart in html element like div or td?
- How to hide div created inside TR in html
- On button click open a new window and draw a circle with D3
- Making An HTML element inside a D3-Tip Trigger Click Event
- D3 javascript not running in html div
- Why won't my d3 html div tooltips hide on mouseout?
- append d3 text to existing html div
- On button click open a new window and draw a large circle with D3
- HTML + (NV)D3: Can't place a div on top of a div of the chart even with > z-index
- Why does shift+click open up new tab in firefox for D3 images but not HTML images
More Query from same tag
- Including D3 in an ERB loop
- Why is my number format choking?
- Generating two dimensional array between min and max number using D3.js
- How to find a d3.js plot element by its connected data?
- How to stop force-directed graph simulation
- Example of d3.js animated Radial Chart
- Time axis in 24 hour clock
- D3.js parseFloat and iterate throught .json
- smooth color transition in chord diagram
- d3.js sankey diagram: where does ".dy" and .dx" get set?
- Parsing a date from C# to javascript with D3js
- Color range for multiple lines
- Appending maps as part of group (multiple maps)
- d3 selectors: Works in code but not in console. Why?
- d3.max doesn't return highest value from csv file
- Better way to convert JSON to arrays for graphing timeseries in C3?
- D3 treemap node order
- D3.js TreeMap - Error: <rect> attribute width: Expected length, "NaN"
- Gridster grid with dc.js and d3-tip Not working
- get all features properties in d3
- How to set up rollup.js with a d3 plugin?
- D3.JS chart not showing
- D3 Collapsible Tree how to make it vertically scrollable
- D3 chart error bars other than stroke type
- Understanding D3 TopoJSON transformations
- how to roll up dc stacked-bar example into single bar?
- Include D3 chart in html element like div or td?
- Trying to Assign Color for Null values in a map D3,js v4
- d3.layout.pack stacks circles when sort is ascending
- polynomial d3-regression loading dataset