Skip to content

Instantly share code, notes, and snippets.

@reinholdsson
Created May 4, 2014 16:56
Show Gist options
  • Save reinholdsson/11519927 to your computer and use it in GitHub Desktop.
Save reinholdsson/11519927 to your computer and use it in GitHub Desktop.
My Chart
a <- Highcharts$new()
a$chart(type = "spline", backgroundColor = NULL)
a$series(data = c(1, 3, 2, 4, 5, 4, 6, 2, 3, 5, NA), dashStyle = "longdash")
a$series(data = c(NA, 4, 1, 3, 4, 2, 9, 1, 2, 3, 1), dashStyle = "shortdot")
a$legend(symbolWidth = 80)
a$set(height = 250)
a
<!doctype HTML>
<meta charset = 'utf-8'>
<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://getbootstrap.com/2.3.2/assets/js/google-code-prettify/prettify.css">
<link rel='stylesheet' href="http://aozora.github.io/bootplus/assets/css/docs.css">
<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>
<style>
.rChart {
display: block
margin: auto auto;
width: 100%;
height: 400px;
}
/*
body {
margin-top: 60px;
}
*/
</style>
</head>
<body>
<div class='container'>
<div class='row'>
<div class='span8'>
<div class="bs-docs-example">
<div id='chartc6ae6188cd84' class='rChart highcharts'>
</div>
<br/>
<pre><code class='r'>a &lt;- Highcharts$new()
a$chart(type = &quot;spline&quot;, backgroundColor = NULL)
a$series(data = c(1, 3, 2, 4, 5, 4, 6, 2, 3, 5, NA), dashStyle = &quot;longdash&quot;)
a$series(data = c(NA, 4, 1, 3, 4, 2, 9, 1, 2, 3, 1), dashStyle = &quot;shortdot&quot;)
a$legend(symbolWidth = 80)
a$set(height = 250)
a
</code></pre>
</div>
</div>
</div>
</div>
<script type='text/javascript'>
(function($){
$(function () {
var chart = new Highcharts.Chart({
"dom": "chartc6ae6188cd84",
"width": 700,
"height": 250,
"credits": {
"href": null,
"text": null
},
"exporting": {
"enabled": false
},
"title": {
"text": null
},
"yAxis": {
"title": {
"text": null
}
},
"chart": {
"type": "spline",
"backgroundColor": null,
"renderTo": "chartc6ae6188cd84"
},
"series": [
{
"data": [
1,
3,
2,
4,
5,
4,
6,
2,
3,
5,
null
],
"dashStyle": "longdash"
},
{
"data": [
null,
4,
1,
3,
4,
2,
9,
1,
2,
3,
1
],
"dashStyle": "shortdot"
}
],
"legend": {
"symbolWidth": 80
},
"id": "chartc6ae6188cd84"
});
});
})(jQuery);
</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