Last active
August 29, 2015 14:04
-
-
Save ramnathv/13b3c696fb21d10e38e3 to your computer and use it in GitHub Desktop.
Pyramid Charts with rCharts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rCharts) | |
h1 <- Highcharts$new() | |
h1$chart(type = "pyramid") | |
h1$series(name='Unique users', data=list( | |
list('Website visits', 15654), | |
list('Downloads', 4064), | |
list('Requested price list', 1987), | |
list('Invoice sent', 976), | |
list('Finalized', 84) | |
)) | |
h1$addAssets(jshead = "http://code.highcharts.com/modules/funnel.js") | |
h1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype HTML> | |
<meta charset = 'utf-8'> | |
<html> | |
<head> | |
<script src='http://code.jquery.com/jquery-1.9.1.min.js' type='text/javascript'></script> | |
<script src='http://code.highcharts.com/highcharts.js' type='text/javascript'></script> | |
<script src='http://code.highcharts.com/highcharts-more.js' type='text/javascript'></script> | |
<script src='http://code.highcharts.com/modules/exporting.js' type='text/javascript'></script> | |
<script src='http://code.highcharts.com/modules/funnel.js' type='text/javascript'></script> | |
<style> | |
.rChart { | |
display: block; | |
margin-left: auto; | |
margin-right: auto; | |
width: 800px; | |
height: 400px; | |
} | |
</style> | |
</head> | |
<body > | |
<div id = 'chartb7e2e2328ca' class = 'rChart highcharts'></div> | |
<script type='text/javascript'> | |
(function($){ | |
$(function () { | |
var chart = new Highcharts.Chart({ | |
"dom": "chartb7e2e2328ca", | |
"width": 800, | |
"height": 400, | |
"credits": { | |
"href": null, | |
"text": null | |
}, | |
"exporting": { | |
"enabled": false | |
}, | |
"title": { | |
"text": null | |
}, | |
"yAxis": { | |
"title": { | |
"text": null | |
} | |
}, | |
"chart": { | |
"type": "pyramid", | |
"renderTo": "chartb7e2e2328ca" | |
}, | |
"series": [ | |
{ | |
"name": "Unique users", | |
"data": [ | |
[ | |
"Website visits", | |
15654 | |
], | |
[ | |
"Downloads", | |
4064 | |
], | |
[ | |
"Requested price list", | |
1987 | |
], | |
[ | |
"Invoice sent", | |
976 | |
], | |
[ | |
"Finalized", | |
84 | |
] | |
] | |
} | |
], | |
"id": "chartb7e2e2328ca" | |
}); | |
}); | |
})(jQuery); | |
</script> | |
<script></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment