add radio buttons and lables to d3.js -


i trying add radio buttons area axis , shapes this:

var trianglefunctions = ['perpendicular bisector', 'median', 'altitude'],     selected = 0;  var form = svg.append('form');  var labelenter = form.selectall('span')                      .data(trianglefunctions)                      .enter().append('span');  labelenter.append('input').attr({   type: 'radio',   class: 'shape',   name: 'mode',   value: function(d, i) {return i;} });  labelenter.append("label").text(function(d) {return d;}); 

you can see jsbin of code here.

the labels , inputs not appearing.

you can use foreignobject (but aware not work in ie):

var form = svg.append("foreignobject").attr("width", "400")     .attr("height", "50").append("xhtml:body").append('form'); 

note body tag required, , has contain xhtml: part.

demo: http://jsbin.com/mafikorezo/edit?js,output


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -