barchart

library(r2d3)

```{d3 data=c(0.3, 0.6, 0.8, 0.95, 0.40, 0.20)} var barHeight = Math.floor(height / data.length);

svg.selectAll('rect') .data(data) .enter().append('rect') .attr('width', function(d) { return d * width; }) .attr('height', barHeight) .attr('y', function(d, i) { return i * barHeight; }) .attr('fill', 'steelblue'); ```



Try the r2d3 package in your browser

Any scripts or data that you put into this service are public.

r2d3 documentation built on March 18, 2022, 7:17 p.m.