1. require(rCharts)
  2. require(reshape2)
  3. licenses <- data.frame(
  4. c("Dimple","Highcharts","Leaflet","Morris","NVD3","Polycharts","Rickshaw","xCharts"),
  5. c("MIT","CCA Noncommercial 3.0","MIT","MIT","Apache Ver 2","CCA Noncommercial 3.0","MIT","MIT"),
  6. c("MIT","Paid","MIT","MIT","Apache Ver 2","Paid","MIT","MIT")
  7. )
  8. colnames(licenses) <- c("Library","Noncommercial","Commercial")
  9. licenses.melt <- melt(licenses, id.var = 1)
  10. colnames(licenses.melt) <- c("Library", "Type", "License")
  11. licPlot <- dPlot(
  12. x = c("License","Type"),
  13. y = "Library",
  14. groups = "Type",
  15. data = licenses.melt,
  16. type = "bar"
  17. )
  18. licPlot$xAxis ( type = "addCategoryAxis" )
  19. licPlot$yAxis ( type = "addCategoryAxis" )
  20. licPlot$legend(
  21. x = 200,
  22. y = 10,
  23. width = 400,
  24. height = 20,
  25. horizontalAlign = "right"
  26. )
  27. licPlot