I am creating a custom legend, that contains radio inputs, of a pie chart created with c3. I create radio inputs via D3 API. I haven't been able to show the text on the side of radio input.
d3.select('.container').insert('div', '.chart')
.selectAll('input')
.data(['data', 'data10', 'data5'])
.enter().append('input')
.attr('type', function (id) { return 'radio'; })
.attr('name', function (id) { return id;})
.attr('value', function (id) { return id;})
.append('span')
.html(function (id) { return id; });
Here is the css:
input{
width:31.5%;
}
input span{
color:red;
background-color: green;
}
None of it has any effect. Here is my full jsfiddle. Any idea what I am doing wrong?