I\'ve been playing with rCharts and nvd3 for a bit of time now. Now I\'m in a situation where I need a bubble chart, or at least a scatterplot where the size of the dots is
It is possible using the chart
method, which allows you to specify size
, color
etc. The implementation is a little clunky right now, and requires you to pass a javascript function that returns the column specifying the size. The #! ... !#
syntax is required to tell rCharts to treat the contents as a JS literal, and not convert it to a string while assembling the payload. The chart can be viewed here
library(rCharts)
p2 <- nPlot(mpg ~ wt, group = 'cyl', data = mtcars, type = 'scatterChart')
p2$xAxis(axisLabel = 'Weight')
p2$chart(size = '#! function(d){return d.gear} !#')
p2