Search code examples
rnvd3.jsrcharts

Increase point size of all points for rCharts NVD3


Based on this question, it is possible to vary the size of points based on a variable in your dataset. Is it possible to simply increase the size of all points to make them more visible?

library(rCharts)
p2 <- nPlot(mpg ~ wt, group = 'cyl', data = mtcars, type = 'scatterChart')
p2$xAxis(axisLabel = 'Weight')
p2$chart(size = '1000') #Also tried 1000, '1000px', etc.
p2

Solution

  • Try this using this very helpful answer d3.v3 scatterplot with all circles the same radius

    library(rCharts)
    p2 <- nPlot(mpg ~ wt, group = 'cyl', data = mtcars, type = 'scatterChart')
    p2$xAxis(axisLabel = 'Weight')
    #p2$chart(size = 100) #Also tried 1000, '1000px', etc.
    p2$chart(sizeRange = c(1000,1000))
    p2