pxkw.hatenadiary.com

めもめも

d3

Text in oval

こーすると <div id="div_tio" ><div> <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> <script type="text/javascript"> var dataset = [ {'name':'v1', 'x':1, 'y':0}, {'name':'v2', 'x':2, 'y':0}, {'name':'v3', 'x':3, 'y':0}, {'name':'v4', 'x':4, 'y':0}, {'name':'v5', 'x':5, 'y':0}, {'name'…</div></div>

D3でbuttonを追加する

こうすると <div id="d_button"></div> <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> <script type="text/javascript"> var dataset = [ 1,2,3,4,5 ]; function onButtonClicked( ){ var text = '(name,value)=(' + this.name + ',' + this.value + ')'; alert( text ); }; d3.select('#d_button') .s…

D3のenterとupdateとexitについて

js d3

The empty selection is joined to data: data(data). The data method binds data to elements, producing three virtual selections: enter, update and exit. The enter selection contains placeholders for any missing elements. The update selection…