Skip to content

Instantly share code, notes, and snippets.

@ramnathv
Created April 23, 2013 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ramnathv/5444144 to your computer and use it in GitHub Desktop.
Save ramnathv/5444144 to your computer and use it in GitHub Desktop.
testing
<!doctype HTML>
<html>
<head>
<link rel='stylesheet' href="http://netdna.bootstrapcdn.com/bootswatch/2.3.1/cosmo/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-responsive.min.css" >
<link rel='stylesheet' href="http://twitter.github.io/bootstrap/assets/js/google-code-prettify/prettify.css">
<script src='https://raw.github.com/Polychart/polychart2/develop/polychart2.standalone.js' type='text/javascript'></script>
<style>
.rChart {
display: block
margin: auto auto;
width: 800px;
height: 400px;
}
body {
margin-top: 60px;
}
</style>
</head>
<body>
<div class='container'>
<div class='row'>
<div class='span9'>
<div id='charte0a4465949b7' class='rChart nvd3Plot'></div>
<pre><code class='r'>browsershare &lt;- read.csv(&quot;http://gs.statcounter.com/chart.php?statType_hidden=browser&amp;region_hidden=ww&amp;granularity=monthly&amp;statType=Browser&amp;region=Worldwide&amp;fromMonthYear=2008-07&amp;toMonthYear=2013-03&amp;csv=1&quot;)
browsershare.melt &lt;- melt(browsershare,id.vars=1)
colnames(browsershare.melt)[c(2,3)] &lt;- c(&quot;Browser&quot;,&quot;Share&quot;)
p3 &lt;- rPlot(Share ~ Date, color = &quot;Browser&quot;,
data=browsershare.melt,
size=list(const=3),
type=&quot;line&quot;)
p3$set(title=&quot;Browser Shares Over Time&quot;)
p3
</code></pre>
</div>
</div>
</div>
<script type='text/javascript'>
var chartParams = {"dom":"charte0a4465949b7","width":800,"height":400,"layers":[{"x":"Date","y":"Share","data":{"Date":["2008-07","2008-08","2008-09","2008-10","2008-11","2008-12","2009-01","2009-02","2009-03","2009-04","2009-05","2009-06","2009-07","2009-08","2009-09","2009-10","2009-11","2009-12","2010-01","2010-02","2010-03","2010-04","2010-05","2010-06","2010-07","2010-08","2010-09","2010-10","2010-11","2010-12","2011-01","2011-02","2011-03","2011-04","2011-05","2011-06","2011-07","2011-08","2011-09","2011-10","2011-11","2011-12","2012-01","2012-02","2012-03","2012-04","2012-05","2012-06","2012-07","2012-08","2012-09","2012-10","2012-11","2012-12","2013-01","2013-02","2013-03","2008-07","2008-08","2008-09","2008-10","2008-11","2008-12","2009-01","2009-02","2009-03","2009-04","2009-05","2009-06","2009-07","2009-08","2009-09","2009-10","2009-11","2009-12","2010-01","2010-02","2010-03","2010-04","2010-05","2010-06","2010-07","2010-08","2010-09","2010-10","2010-11","2010-12","2011-01","2011-02","2011-03","2011-04","2011-05","2011-06","2011-07","2011-08","2011-09","2011-10","2011-11","2011-12","2012-01","2012-02","2012-03","2012-04","2012-05","2012-06","2012-07","2012-08","2012-09","2012-10","2012-11","2012-12","2013-01","2013-02","2013-03","2008-07","2008-08","2008-09","2008-10","2008-11","2008-12","2009-01","2009-02","2009-03","2009-04","2009-05","2009-06","2009-07","2009-08","2009-09","2009-10","2009-11","2009-12","2010-01","2010-02","2010-03","2010-04","2010-05","2010-06","2010-07","2010-08","2010-09","2010-10","2010-11","2010-12","2011-01","2011-02","2011-03","2011-04","2011-05","2011-06","2011-07","2011-08","2011-09","2011-10","2011-11","2011-12","2012-01","2012-02","2012-03","2012-04","2012-05","2012-06","2012-07","2012-08","2012-09","2012-10","2012-11","2012-12","2013-01","2013-02","2013-03","2008-07","2008-08","2008-09","2008-10","2008-11","2008-12","2009-01","2009-02","2009-03","2009-04","2009-05","2009-06","2009-07","2009-08","2009-09","2009-10","2009-11","2009-12","2010-01","2010-02","2010-03","2010-04","2010-05","2010-06","2010-07","2010-08","2010-09","2010-10","2010-11","2010-12","2011-01","2011-02","2011-03","2011-04","2011-05","2011-06","2011-07","2011-08","2011-09","2011-10","2011-11","2011-12","2012-01","2012-02","2012-03","2012-04","2012-05","2012-06","2012-07","2012-08","2012-09","2012-10","2012-11","2012-12","2013-01","2013-02","2013-03","2008-07","2008-08","2008-09","2008-10","2008-11","2008-12","2009-01","2009-02","2009-03","2009-04","2009-05","2009-06","2009-07","2009-08","2009-09","2009-10","2009-11","2009-12","2010-01","2010-02","2010-03","2010-04","2010-05","2010-06","2010-07","2010-08","2010-09","2010-10","2010-11","2010-12","2011-01","2011-02","2011-03","2011-04","2011-05","2011-06","2011-07","2011-08","2011-09","2011-10","2011-11","2011-12","2012-01","2012-02","2012-03","2012-04","2012-05","2012-06","2012-07","2012-08","2012-09","2012-10","2012-11","2012-12","2013-01","2013-02","2013-03","2008-07","2008-08","2008-09","2008-10","2008-11","2008-12","2009-01","2009-02","2009-03","2009-04","2009-05","2009-06","2009-07","2009-08","2009-09","2009-10","2009-11","2009-12","2010-01","2010-02","2010-03","2010-04","2010-05","2010-06","2010-07","2010-08","2010-09","2010-10","2010-11","2010-12","2011-01","2011-02","2011-03","2011-04","2011-05","2011-06","2011-07","2011-08","2011-09","2011-10","2011-11","2011-12","2012-01","2012-02","2012-03","2012-04","2012-05","2012-06","2012-07","2012-08","2012-09","2012-10","2012-11","2012-12","2013-01","2013-02","2013-03"],"Browser":["IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","IE","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Firefox","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Chrome","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Safari","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Opera","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other","Other"],"Share":[68.57,68.91,67.16,67.68,68.14,67.84,65.41,64.43,62.52,61.88,62.09,59.49,60.11,58.69,58.37,57.96,56.57,55.72,55.25,54.5,54.44,53.26,52.77,52.86,52.68,51.34,49.87,49.21,48.16,46.94,46,45.44,45.11,44.52,43.87,43.58,42.45,41.89,41.66,40.18,40.63,38.65,37.45,35.75,34.81,34.07,32.12,32.31,32.04,32.85,32.7,32.08,31.23,30.78,30.71,29.82,29.3,26.14,26.08,25.77,25.54,25.27,25.23,27.03,27.85,29.4,29.67,28.75,30.33,30.5,31.28,31.34,31.82,32.21,31.97,31.64,31.82,31.27,31.74,31.64,31.15,30.69,31.09,31.5,31.24,31.17,30.76,30.68,30.37,29.98,29.67,29.29,28.34,27.95,27.49,26.79,26.39,25.23,25.27,24.78,24.88,24.98,24.87,25.55,24.56,23.73,22.85,22.4,22.32,22.37,21.89,21.42,21.34,20.87,0,0,1.03,1.02,0.93,1.21,1.38,1.52,1.73,2.07,2.42,2.82,3.01,3.38,3.69,4.17,4.66,5.45,6.04,6.72,7.29,8.06,8.61,9.24,9.88,10.76,11.54,12.39,13.35,14.85,15.68,16.54,17.37,18.29,19.36,20.65,22.14,23.16,23.61,25,25.69,27.27,28.4,29.84,30.87,31.23,32.43,32.76,33.81,33.59,34.21,34.77,35.72,36.42,36.52,37.09,38.07,3.3,2.99,3,2.91,2.49,2.41,2.57,2.59,2.73,2.75,2.65,2.93,3.02,3.25,3.28,3.47,3.67,3.48,3.76,4.08,4.16,4.23,4.14,4.07,4.09,4.23,4.42,4.56,4.7,4.79,5.09,5.08,5.02,5.04,5.01,5.07,5.17,5.19,5.6,5.93,5.92,6.08,6.62,6.77,6.72,7.13,7.09,7,7.12,7.39,7.7,7.81,7.83,7.92,8.29,8.6,8.5,1.78,1.83,2.86,2.69,3.01,2.83,2.92,2.95,2.94,2.96,3.23,3.36,2.64,2.67,2.62,1.88,2.02,2.06,2,1.97,1.97,1.82,1.96,1.91,1.91,1.88,2.03,2,2.01,2.07,2,2,1.97,1.91,1.84,1.74,1.66,1.67,1.72,1.81,1.82,1.98,1.95,2.02,1.78,1.72,1.77,1.77,1.72,1.63,1.61,1.63,1.39,1.26,1.19,1.22,1.17,0.21,0.2,0.18,0.17,0.16,0.48,0.7,0.67,0.68,0.68,0.87,1.07,0.72,0.73,0.7,0.7,0.86,1.31,1.31,0.91,0.87,0.89,0.88,0.77,0.74,0.7,0.63,0.6,0.6,0.58,0.55,0.55,0.54,0.57,0.63,0.61,0.63,0.61,0.62,0.69,0.71,0.75,0.79,0.73,0.82,0.98,1.04,1.61,1.58,1.69,1.38,1.39,1.46,1.72,1.87,1.93,2.09]},"facet":null,"color":"Browser","size":{"const":3},"type":"line"}],"facet":[],"guides":[],"coord":[],"title":"Browser Shares Over Time","id":"charte0a4465949b7"}
_.each(chartParams.layers, function(el){
el.data = polyjs.data(el.data)
})
var graph_charte0a4465949b7 = polyjs.chart(chartParams);
</script>
</body>
<!-- Google Prettify -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/prettify/188.0.0/prettify.js"></script>
<script
src='https://google-code-prettify.googlecode.com/svn-history/r232/trunk/src/lang-r.js'>
</script>
<script>
var pres = document.getElementsByTagName("pre");
for (var i=0; i < pres.length; ++i) {
pres[i].className = "prettyprint linenums";
}
prettyPrint();
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment