Skip to content

Instantly share code, notes, and snippets.

@timelyportfolio
Forked from ramnathv/code.R
Last active August 29, 2015 13:58
Show Gist options
  • Save timelyportfolio/10184829 to your computer and use it in GitHub Desktop.
Save timelyportfolio/10184829 to your computer and use it in GitHub Desktop.
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$chart(color = c('red', 'green', 'blue'))
p2$chart(
tooltipXContent = NA,
tooltipYContent = NA
)
p2$chart(
tooltipContent = '#! function(x,y,e,graph){
return d3.entries(graph.point).map(function(key){
return key.key + \': \' + key.value;
}).join(\',\');
} !#'
)
p2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment