apexcharter/docs/articles/starting-with-apexcharts.html

276 lines
78 KiB
HTML

<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Starting with ApexCharts • apexcharter</title>
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script><!-- sticky kit --><script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script><meta property="og:title" content="Starting with ApexCharts">
<meta property="og:description" content="">
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-article">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">apexcharter</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.1.1</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../articles/starting-with-apexcharts.html">Get started</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/labs.html">Labs: title, subtitle &amp; axis</a>
</li>
<li>
<a href="../articles/lines.html">Options &amp; styles for lines</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">News</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/dreamRs/apexcharter">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><script src="starting-with-apexcharts_files/htmlwidgets-1.3/htmlwidgets.js"></script><script src="starting-with-apexcharts_files/apexcharts-3.8.2/apexcharts.min.js"></script><script src="starting-with-apexcharts_files/apexcharter-binding-0.1.1/apexcharter.js"></script><div class="row">
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1>Starting with ApexCharts</h1>
<h4 class="author">Victor Perrier</h4>
<h4 class="date">2019-07-29</h4>
<small class="dont-index">Source: <a href="https://github.com/dreamRs/apexcharter/blob/master/vignettes/starting-with-apexcharts.Rmd"><code>vignettes/starting-with-apexcharts.Rmd</code></a></small>
<div class="hidden name"><code>starting-with-apexcharts.Rmd</code></div>
</div>
<p>The objective of this vignette is to show how to quickly build data visualizations with the ApexCharts JavaScript library, as well as to give an overview of the different graphics available.</p>
<p>Data used are from <code>ggplot2</code> package, data manipulation will be done with the <code>dplyr</code> package.</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(ggplot2)</a>
<a class="sourceLine" id="cb1-2" title="2"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(dplyr)</a>
<a class="sourceLine" id="cb1-3" title="3"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(apexcharter)</a></code></pre></div>
<div id="bar-charts" class="section level2">
<h2 class="hasAnchor">
<a href="#bar-charts" class="anchor"></a>Bar charts</h2>
<p>Simple bar charts can be created with:</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/data">data</a></span>(<span class="st">"mpg"</span>)</a>
<a class="sourceLine" id="cb2-2" title="2">n_manufac &lt;-<span class="st"> </span><span class="kw">count</span>(mpg, manufacturer)</a>
<a class="sourceLine" id="cb2-3" title="3"></a>
<a class="sourceLine" id="cb2-4" title="4"><span class="kw"><a href="../reference/apex.html">apex</a></span>(<span class="dt">data =</span> n_manufac, <span class="dt">type =</span> <span class="st">"column"</span>, <span class="dt">mapping =</span> <span class="kw"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="dt">x =</span> manufacturer, <span class="dt">y =</span> n))</a></code></pre></div>
<div id="htmlwidget-7178054bfbe2017c3732" style="width:100%;height:350px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-7178054bfbe2017c3732">{"x":{"ax_opts":{"chart":{"type":"bar"},"series":[{"name":"n","data":[{"x":"audi","y":18},{"x":"chevrolet","y":19},{"x":"dodge","y":37},{"x":"ford","y":25},{"x":"honda","y":9},{"x":"hyundai","y":14},{"x":"jeep","y":8},{"x":"land rover","y":4},{"x":"lincoln","y":3},{"x":"mercury","y":4},{"x":"nissan","y":13},{"x":"pontiac","y":5},{"x":"subaru","y":14},{"x":"toyota","y":34},{"x":"volkswagen","y":27}]}],"dataLabels":{"enabled":false},"plotOptions":{"bar":{"horizontal":false}}},"auto_update":true},"evals":[],"jsHooks":[]}</script><p>Flipping coordinates can be done by using <code>type = "bar"</code>:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" title="1"><span class="kw"><a href="../reference/apex.html">apex</a></span>(<span class="dt">data =</span> n_manufac, <span class="dt">type =</span> <span class="st">"bar"</span>, <span class="dt">mapping =</span> <span class="kw"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="dt">x =</span> manufacturer, <span class="dt">y =</span> n))</a></code></pre></div>
<div id="htmlwidget-75df874f09850eb26c83" style="width:100%;height:350px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-75df874f09850eb26c83">{"x":{"ax_opts":{"chart":{"type":"bar"},"series":[{"name":"n","data":[{"x":"audi","y":18},{"x":"chevrolet","y":19},{"x":"dodge","y":37},{"x":"ford","y":25},{"x":"honda","y":9},{"x":"hyundai","y":14},{"x":"jeep","y":8},{"x":"land rover","y":4},{"x":"lincoln","y":3},{"x":"mercury","y":4},{"x":"nissan","y":13},{"x":"pontiac","y":5},{"x":"subaru","y":14},{"x":"toyota","y":34},{"x":"volkswagen","y":27}]}],"dataLabels":{"enabled":false},"plotOptions":{"bar":{"horizontal":true}},"grid":{"yaxis":{"lines":{"show":false}},"xaxis":{"lines":{"show":true}}}},"auto_update":true},"evals":[],"jsHooks":[]}</script><p>To create a dodge bar charts, use aesthetic <code>fill</code> :</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" title="1">n_manufac_year &lt;-<span class="st"> </span><span class="kw">count</span>(mpg, manufacturer, year)</a>
<a class="sourceLine" id="cb4-2" title="2"></a>
<a class="sourceLine" id="cb4-3" title="3"><span class="kw"><a href="../reference/apex.html">apex</a></span>(<span class="dt">data =</span> n_manufac_year, <span class="dt">type =</span> <span class="st">"column"</span>, <span class="dt">mapping =</span> <span class="kw"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="dt">x =</span> manufacturer, <span class="dt">y =</span> n, <span class="dt">fill =</span> year))</a></code></pre></div>
<div id="htmlwidget-431b7617d01fb00d303f" style="width:100%;height:350px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-431b7617d01fb00d303f">{"x":{"ax_opts":{"chart":{"type":"bar"},"series":[{"name":1999,"data":[{"x":"audi","y":9},{"x":"chevrolet","y":7},{"x":"dodge","y":16},{"x":"ford","y":15},{"x":"honda","y":5},{"x":"hyundai","y":6},{"x":"jeep","y":2},{"x":"land rover","y":2},{"x":"lincoln","y":2},{"x":"mercury","y":2},{"x":"nissan","y":6},{"x":"pontiac","y":3},{"x":"subaru","y":6},{"x":"toyota","y":20},{"x":"volkswagen","y":16}]},{"name":2008,"data":[{"x":"audi","y":9},{"x":"chevrolet","y":12},{"x":"dodge","y":21},{"x":"ford","y":10},{"x":"honda","y":4},{"x":"hyundai","y":8},{"x":"jeep","y":6},{"x":"land rover","y":2},{"x":"lincoln","y":1},{"x":"mercury","y":2},{"x":"nissan","y":7},{"x":"pontiac","y":2},{"x":"subaru","y":8},{"x":"toyota","y":14},{"x":"volkswagen","y":11}]}],"dataLabels":{"enabled":false},"plotOptions":{"bar":{"horizontal":false}}},"auto_update":true},"evals":[],"jsHooks":[]}</script><p>For stacked bar charts, specify option <code>stacked</code> in <code>ax_chart</code> :</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" title="1"><span class="kw"><a href="../reference/apex.html">apex</a></span>(<span class="dt">data =</span> n_manufac_year, <span class="dt">type =</span> <span class="st">"column"</span>, <span class="dt">mapping =</span> <span class="kw"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="dt">x =</span> manufacturer, <span class="dt">y =</span> n, <span class="dt">fill =</span> year)) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb5-2" title="2"><span class="st"> </span><span class="kw"><a href="../reference/ax_chart.html">ax_chart</a></span>(<span class="dt">stacked =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
<div id="htmlwidget-8dd7bdbab832e01c8ed3" style="width:100%;height:350px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-8dd7bdbab832e01c8ed3">{"x":{"ax_opts":{"chart":{"type":"bar","stacked":true},"series":[{"name":1999,"data":[{"x":"audi","y":9},{"x":"chevrolet","y":7},{"x":"dodge","y":16},{"x":"ford","y":15},{"x":"honda","y":5},{"x":"hyundai","y":6},{"x":"jeep","y":2},{"x":"land rover","y":2},{"x":"lincoln","y":2},{"x":"mercury","y":2},{"x":"nissan","y":6},{"x":"pontiac","y":3},{"x":"subaru","y":6},{"x":"toyota","y":20},{"x":"volkswagen","y":16}]},{"name":2008,"data":[{"x":"audi","y":9},{"x":"chevrolet","y":12},{"x":"dodge","y":21},{"x":"ford","y":10},{"x":"honda","y":4},{"x":"hyundai","y":8},{"x":"jeep","y":6},{"x":"land rover","y":2},{"x":"lincoln","y":1},{"x":"mercury","y":2},{"x":"nissan","y":7},{"x":"pontiac","y":2},{"x":"subaru","y":8},{"x":"toyota","y":14},{"x":"volkswagen","y":11}]}],"dataLabels":{"enabled":false},"plotOptions":{"bar":{"horizontal":false}}},"auto_update":true},"evals":[],"jsHooks":[]}</script>
</div>
<div id="line-charts" class="section level2">
<h2 class="hasAnchor">
<a href="#line-charts" class="anchor"></a>Line charts</h2>
<p>Simple line charts can be created with (works with <code>character</code>, <code>Date</code> or <code>POSIXct</code>):</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/data">data</a></span>(<span class="st">"economics"</span>)</a>
<a class="sourceLine" id="cb6-2" title="2">economics &lt;-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/head">tail</a></span>(economics, <span class="dv">100</span>)</a>
<a class="sourceLine" id="cb6-3" title="3"></a>
<a class="sourceLine" id="cb6-4" title="4"><span class="kw"><a href="../reference/apex.html">apex</a></span>(<span class="dt">data =</span> economics, <span class="dt">type =</span> <span class="st">"line"</span>, <span class="dt">mapping =</span> <span class="kw"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="dt">x =</span> date, <span class="dt">y =</span> uempmed))</a></code></pre></div>
<div id="htmlwidget-d226dd80508cbbef9b2f" style="width:100%;height:350px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-d226dd80508cbbef9b2f">{"x":{"ax_opts":{"chart":{"type":"line"},"series":[{"name":"uempmed","data":[["2007-01-01",8.3],["2007-02-01",8.5],["2007-03-01",9.1],["2007-04-01",8.6],["2007-05-01",8.2],["2007-06-01",7.7],["2007-07-01",8.7],["2007-08-01",8.8],["2007-09-01",8.7],["2007-10-01",8.4],["2007-11-01",8.6],["2007-12-01",8.4],["2008-01-01",9],["2008-02-01",8.7],["2008-03-01",8.7],["2008-04-01",9.4],["2008-05-01",7.9],["2008-06-01",9],["2008-07-01",9.7],["2008-08-01",9.7],["2008-09-01",10.2],["2008-10-01",10.4],["2008-11-01",9.8],["2008-12-01",10.5],["2009-01-01",10.7],["2009-02-01",11.7],["2009-03-01",12.3],["2009-04-01",13.1],["2009-05-01",14.2],["2009-06-01",17.2],["2009-07-01",16],["2009-08-01",16.3],["2009-09-01",17.8],["2009-10-01",18.9],["2009-11-01",19.8],["2009-12-01",20.1],["2010-01-01",20],["2010-02-01",19.9],["2010-03-01",20.4],["2010-04-01",22.1],["2010-05-01",22.3],["2010-06-01",25.2],["2010-07-01",22.3],["2010-08-01",21],["2010-09-01",20.3],["2010-10-01",21.2],["2010-11-01",21],["2010-12-01",21.9],["2011-01-01",21.5],["2011-02-01",21.1],["2011-03-01",21.5],["2011-04-01",20.9],["2011-05-01",21.6],["2011-06-01",22.4],["2011-07-01",22],["2011-08-01",22.4],["2011-09-01",22],["2011-10-01",20.6],["2011-11-01",20.8],["2011-12-01",20.5],["2012-01-01",20.8],["2012-02-01",19.7],["2012-03-01",19.2],["2012-04-01",19.1],["2012-05-01",19.9],["2012-06-01",20.4],["2012-07-01",17.5],["2012-08-01",18.4],["2012-09-01",18.8],["2012-10-01",19.9],["2012-11-01",18.6],["2012-12-01",17.7],["2013-01-01",15.8],["2013-02-01",17.2],["2013-03-01",17.6],["2013-04-01",17.1],["2013-05-01",17.1],["2013-06-01",17],["2013-07-01",16.2],["2013-08-01",16.5],["2013-09-01",16.5],["2013-10-01",16.3],["2013-11-01",17.1],["2013-12-01",17.3],["2014-01-01",15.4],["2014-02-01",15.9],["2014-03-01",15.8],["2014-04-01",15.7],["2014-05-01",14.6],["2014-06-01",13.8],["2014-07-01",13.1],["2014-08-01",12.9],["2014-09-01",13.4],["2014-10-01",13.6],["2014-11-01",13],["2014-12-01",12.9],["2015-01-01",13.2],["2015-02-01",12.9],["2015-03-01",12],["2015-04-01",11.5]]}],"dataLabels":{"enabled":false},"stroke":{"curve":"straight"},"xaxis":{"type":"datetime"}},"auto_update":true},"evals":[],"jsHooks":[]}</script><p>To represent several lines, use a <code>data.frame</code> in long format and the <code>group</code> aesthetic:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/data">data</a></span>(<span class="st">"economics_long"</span>)</a>
<a class="sourceLine" id="cb7-2" title="2">economics_long &lt;-<span class="st"> </span>economics_long <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb7-3" title="3"><span class="st"> </span><span class="kw">group_by</span>(variable) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb7-4" title="4"><span class="st"> </span><span class="kw">slice</span>((<span class="kw">n</span>()<span class="op">-</span><span class="dv">100</span>)<span class="op">:</span><span class="kw">n</span>())</a>
<a class="sourceLine" id="cb7-5" title="5"></a>
<a class="sourceLine" id="cb7-6" title="6"><span class="kw"><a href="../reference/apex.html">apex</a></span>(<span class="dt">data =</span> economics_long, <span class="dt">type =</span> <span class="st">"line"</span>, <span class="dt">mapping =</span> <span class="kw"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="dt">x =</span> date, <span class="dt">y =</span> value01, <span class="dt">group =</span> variable)) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb7-7" title="7"><span class="st"> </span><span class="kw"><a href="../reference/ax_yaxis.html">ax_yaxis</a></span>(<span class="dt">decimalsInFloat =</span> <span class="dv">2</span>) <span class="co"># number of decimals to keep</span></a></code></pre></div>
<div id="htmlwidget-59431f591f3226c40acc" style="width:100%;height:350px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-59431f591f3226c40acc">{"x":{"ax_opts":{"chart":{"type":"line"},"series":[{"name":"pce","data":[["2006-12-01",0.766854052759025],["2007-01-01",0.77090125009626],["2007-02-01",0.773510965081158],["2007-03-01",0.776788082586784],["2007-04-01",0.779406354014255],["2007-05-01",0.782452447570398],["2007-06-01",0.783821478382148],["2007-07-01",0.787440853590711],["2007-08-01",0.791231357650743],["2007-09-01",0.794996192383055],["2007-10-01",0.797486117171925],["2007-11-01",0.803544078513917],["2007-12-01",0.804451061426701],["2008-01-01",0.806299253022563],["2008-02-01",0.804878883555373],["2008-03-01",0.808814847139153],["2008-04-01",0.812014956661618],["2008-05-01",0.816892128928477],["2008-06-01",0.821521164360705],["2008-07-01",0.821247358198356],["2008-08-01",0.820391713941012],["2008-09-01",0.816010815343413],["2008-10-01",0.808891855122314],["2008-11-01",0.796955617732372],["2008-12-01",0.789246262973706],["2009-01-01",0.7937897339802],["2009-02-01",0.792266687202129],["2009-03-01",0.788202376979747],["2009-04-01",0.788741432861873],["2009-05-01",0.790803535522071],["2009-06-01",0.795766272214664],["2009-07-01",0.79874391423022],["2009-08-01",0.808951750220328],["2009-09-01",0.802311950783342],["2009-10-01",0.806461825431459],["2009-11-01",0.807197679492774],["2009-12-01",0.81219464195566],["2010-01-01",0.81244277879029],["2010-02-01",0.81490703425144],["2010-03-01",0.8199125531569],["2010-04-01",0.821948986489377],["2010-05-01",0.823497702595169],["2010-06-01",0.82524321688015],["2010-07-01",0.828092512257104],["2010-08-01",0.831814564776549],["2010-09-01",0.833594304831823],["2010-10-01",0.838360243345227],["2010-11-01",0.842638464631945],["2010-12-01",0.84583857415441],["2011-01-01",0.849552070231281],["2011-02-01",0.852512599361689],["2011-03-01",0.859391979190732],["2011-04-01",0.862566419385476],["2011-05-01",0.864654191373395],["2011-06-01",0.866776189131607],["2011-07-01",0.870258661258995],["2011-08-01",0.872235199493459],["2011-09-01",0.875443865458497],["2011-10-01",0.876727331844512],["2011-11-01",0.877274944169212],["2011-12-01",0.878361612376039],["2012-01-01",0.886053854249557],["2012-02-01",0.893874442761677],["2012-03-01",0.893728983237929],["2012-04-01",0.896116230715918],["2012-05-01",0.895166465590266],["2012-06-01",0.89325837889639],["2012-07-01",0.895902319651582],["2012-08-01",0.898204002703836],["2012-09-01",0.903115400740988],["2012-10-01",0.906392518246614],["2012-11-01",0.909558401998785],["2012-12-01",0.909874990374002],["2013-01-01",0.915205654097253],["2013-02-01",0.918354424964277],["2013-03-01",0.917284869642597],["2013-04-01",0.915428121604162],["2013-05-01",0.918782247092949],["2013-06-01",0.92085290619572],["2013-07-01",0.923240153673709],["2013-08-01",0.926020997510075],["2013-09-01",0.92924677636026],["2013-10-01",0.933773134481608],["2013-11-01",0.939574402546397],["2013-12-01",0.942167004646148],["2014-01-01",0.941704956747183],["2014-02-01",0.946299766409118],["2014-03-01",0.952871114305516],["2014-04-01",0.957970754079284],["2014-05-01",0.961889604777918],["2014-06-01",0.967759324383294],["2014-07-01",0.971481376902739],["2014-08-01",0.978651675779278],["2014-09-01",0.979772569756398],["2014-10-01",0.985385596084572],["2014-11-01",0.987815625775428],["2014-12-01",0.988722608688212],["2015-01-01",0.987353577876462],["2015-02-01",0.990468122973193],["2015-03-01",0.99696246288643],["2015-04-01",1]]},{"name":"pop","data":[["2006-12-01",0.835136442063848],["2007-01-01",0.8370593562946],["2007-02-01",0.838932965032257],["2007-03-01",0.840732615530269],["2007-04-01",0.842647312178839],["2007-05-01",0.844529138498678],["2007-06-01",0.84663283953745],["2007-07-01",0.848810498815867],["2007-08-01",0.850971722929918],["2007-09-01",0.853264428358893],["2007-10-01",0.855409217308578],["2007-11-01",0.857438960107706],["2007-12-01",0.859353656756276],["2008-01-01",0.861153307254289],["2008-02-01",0.862837911601743],["2008-03-01",0.864448557709553],["2008-04-01",0.866174249967921],["2008-05-01",0.867867071897558],["2008-06-01",0.869781768546128],["2008-07-01",0.871770423434342],["2008-08-01",0.87380016623347],["2008-09-01",0.875969607929704],["2008-10-01",0.877982915564467],["2008-11-01",0.879889394630854],["2008-12-01",0.881680827546683],["2009-01-01",0.883357214311955],["2009-02-01",0.884951425255399],["2009-03-01",0.886479895541382],["2009-04-01",0.888115194395741],["2009-05-01",0.889734058085733],["2009-06-01",0.891558361330294],["2009-07-01",0.893473057978864],["2009-08-01",0.895494583195809],["2009-09-01",0.897639372145494],["2009-10-01",0.899636244615892],["2009-11-01",0.901518070935731],["2009-12-01",0.903284851105012],["2010-01-01",0.904928367541553],["2010-02-01",0.906522578484998],["2010-03-01",0.908042831188798],["2010-04-01",0.907871995872802],["2010-05-01",0.909333427123338],["2010-06-01",0.910808064028442],["2010-07-01",0.912428538364542],["2010-08-01",0.914171298541104],["2010-09-01",0.915968409806222],["2010-10-01",0.917804973683399],["2010-11-01",0.919414025580265],["2010-12-01",0.920942011028899],["2011-01-01",0.92241324585498],["2011-02-01",0.923667544729019],["2011-03-01",0.924916847313091],["2011-04-01",0.926320689747691],["2011-05-01",0.927724597922949],["2011-06-01",0.929237808158818],["2011-07-01",0.930929200229156],["2011-08-01",0.932641070514292],["2011-09-01",0.934479762745255],["2011-10-01",0.936246879835405],["2011-11-01",0.93777012373912],["2011-12-01",0.939250841655039],["2012-01-01",0.940676320983526],["2012-02-01",0.941956603852427],["2012-03-01",0.943274638293876],["2012-04-01",0.944653203445681],["2012-05-01",0.945995981027082],["2012-06-01",0.947533194820507],["2012-07-01",0.949120765957549],["2012-08-01",0.95085923655621],["2012-09-01",0.952703327738667],["2012-10-01",0.954406249076806],["2012-11-01",0.956048820491396],["2012-12-01",0.957518855550477],["2013-01-01",0.958807725792759],["2013-02-01",0.959880514711547],["2013-03-01",0.961048077005648],["2013-04-01",0.962326987538324],["2013-05-01",0.963689454446634],["2013-06-01",0.965229330736687],["2013-07-01",0.966772066745339],["2013-08-01",0.968592663860335],["2013-09-01",0.970448177482025],["2013-10-01",0.972224366782906],["2013-11-01",0.97391518362249],["2013-12-01",0.975423315392571],["2014-01-01",0.976921972290395],["2014-02-01",0.97823645673634],["2014-03-01",0.97957855225842],["2014-04-01",0.980992099657577],["2014-05-01",0.982473622896551],["2014-06-01",0.984073150615668],["2014-07-01",0.985702006885595],["2014-08-01",0.987603703319152],["2014-09-01",0.989506155770269],["2014-10-01",0.991383363808922],["2014-11-01",0.993112959418826],["2014-12-01",0.994608132061805],["2015-01-01",0.996107750416745],["2015-02-01",0.997306408041825],["2015-03-01",0.998590610697427],["2015-04-01",1]]},{"name":"psavert","data":[["2006-12-01",0.0993377483443709],["2007-01-01",0.0993377483443709],["2007-02-01",0.125827814569536],["2007-03-01",0.145695364238411],["2007-04-01",0.132450331125828],["2007-05-01",0.119205298013245],["2007-06-01",0.105960264900662],["2007-07-01",0.0993377483443709],["2007-08-01",0.0794701986754967],["2007-09-01",0.0860927152317881],["2007-10-01",0.0794701986754967],["2007-11-01",0.0596026490066225],["2007-12-01",0.0927152317880795],["2008-01-01",0.0993377483443709],["2008-02-01",0.125827814569536],["2008-03-01",0.119205298013245],["2008-04-01",0.0794701986754967],["2008-05-01",0.370860927152318],["2008-06-01",0.218543046357616],["2008-07-01",0.145695364238411],["2008-08-01",0.105960264900662],["2008-09-01",0.165562913907285],["2008-10-01",0.218543046357616],["2008-11-01",0.278145695364238],["2008-12-01",0.278145695364238],["2009-01-01",0.264900662251656],["2009-02-01",0.218543046357616],["2009-03-01",0.245033112582781],["2009-04-01",0.304635761589404],["2009-05-01",0.397350993377483],["2009-06-01",0.298013245033113],["2009-07-01",0.251655629139073],["2009-08-01",0.178807947019868],["2009-09-01",0.245033112582781],["2009-10-01",0.211920529801325],["2009-11-01",0.245033112582781],["2009-12-01",0.245033112582781],["2010-01-01",0.258278145695364],["2010-02-01",0.23841059602649],["2010-03-01",0.231788079470199],["2010-04-01",0.278145695364238],["2010-05-01",0.317880794701987],["2010-06-01",0.311258278145695],["2010-07-01",0.304635761589404],["2010-08-01",0.311258278145695],["2010-09-01",0.298013245033113],["2010-10-01",0.291390728476821],["2010-11-01",0.291390728476821],["2010-12-01",0.324503311258278],["2011-01-01",0.344370860927152],["2011-02-01",0.357615894039735],["2011-03-01",0.317880794701987],["2011-04-01",0.311258278145695],["2011-05-01",0.311258278145695],["2011-06-01",0.33112582781457],["2011-07-01",0.337748344370861],["2011-08-01",0.33112582781457],["2011-09-01",0.304635761589404],["2011-10-01",0.304635761589404],["2011-11-01",0.317880794701987],["2011-12-01",0.370860927152318],["2012-01-01",0.384105960264901],["2012-02-01",0.384105960264901],["2012-03-01",0.417218543046358],["2012-04-01",0.43046357615894],["2012-05-01",0.437086092715232],["2012-06-01",0.456953642384106],["2012-07-01",0.397350993377483],["2012-08-01",0.384105960264901],["2012-09-01",0.397350993377483],["2012-10-01",0.437086092715232],["2012-11-01",0.496688741721854],["2012-12-01",0.649006622516556],["2013-01-01",0.271523178807947],["2013-02-01",0.23841059602649],["2013-03-01",0.245033112582781],["2013-04-01",0.278145695364238],["2013-05-01",0.298013245033113],["2013-06-01",0.304635761589404],["2013-07-01",0.291390728476821],["2013-08-01",0.298013245033113],["2013-09-01",0.304635761589404],["2013-10-01",0.271523178807947],["2013-11-01",0.264900662251656],["2013-12-01",0.278145695364238],["2014-01-01",0.324503311258278],["2014-02-01",0.337748344370861],["2014-03-01",0.344370860927152],["2014-04-01",0.344370860927152],["2014-05-01",0.344370860927152],["2014-06-01",0.344370860927152],["2014-07-01",0.350993377483444],["2014-08-01",0.33112582781457],["2014-09-01",0.344370860927152],["2014-10-01",0.33112582781457],["2014-11-01",0.337748344370861],["2014-12-01",0.357615894039735],["2015-01-01",0.364238410596026],["2015-02-01",0.377483443708609],["2015-03-01",0.344370860927152],["2015-04-01",0.357615894039735]]},{"name":"uempmed","data":[["2006-12-01",0.165094339622642],["2007-01-01",0.202830188679245],["2007-02-01",0.212264150943396],["2007-03-01",0.240566037735849],["2007-04-01",0.216981132075472],["2007-05-01",0.19811320754717],["2007-06-01",0.174528301886792],["2007-07-01",0.221698113207547],["2007-08-01",0.226415094339623],["2007-09-01",0.221698113207547],["2007-10-01",0.207547169811321],["2007-11-01",0.216981132075472],["2007-12-01",0.207547169811321],["2008-01-01",0.235849056603774],["2008-02-01",0.221698113207547],["2008-03-01",0.221698113207547],["2008-04-01",0.254716981132075],["2008-05-01",0.183962264150943],["2008-06-01",0.235849056603774],["2008-07-01",0.268867924528302],["2008-08-01",0.268867924528302],["2008-09-01",0.292452830188679],["2008-10-01",0.30188679245283],["2008-11-01",0.273584905660377],["2008-12-01",0.306603773584906],["2009-01-01",0.316037735849057],["2009-02-01",0.363207547169811],["2009-03-01",0.391509433962264],["2009-04-01",0.429245283018868],["2009-05-01",0.481132075471698],["2009-06-01",0.622641509433962],["2009-07-01",0.566037735849057],["2009-08-01",0.580188679245283],["2009-09-01",0.650943396226415],["2009-10-01",0.702830188679245],["2009-11-01",0.745283018867925],["2009-12-01",0.759433962264151],["2010-01-01",0.754716981132076],["2010-02-01",0.75],["2010-03-01",0.773584905660377],["2010-04-01",0.85377358490566],["2010-05-01",0.863207547169811],["2010-06-01",1],["2010-07-01",0.863207547169811],["2010-08-01",0.80188679245283],["2010-09-01",0.768867924528302],["2010-10-01",0.811320754716981],["2010-11-01",0.80188679245283],["2010-12-01",0.844339622641509],["2011-01-01",0.825471698113208],["2011-02-01",0.806603773584906],["2011-03-01",0.825471698113208],["2011-04-01",0.797169811320755],["2011-05-01",0.830188679245283],["2011-06-01",0.867924528301887],["2011-07-01",0.849056603773585],["2011-08-01",0.867924528301887],["2011-09-01",0.849056603773585],["2011-10-01",0.783018867924528],["2011-11-01",0.792452830188679],["2011-12-01",0.778301886792453],["2012-01-01",0.792452830188679],["2012-02-01",0.740566037735849],["2012-03-01",0.716981132075472],["2012-04-01",0.712264150943396],["2012-05-01",0.75],["2012-06-01",0.773584905660377],["2012-07-01",0.636792452830189],["2012-08-01",0.679245283018868],["2012-09-01",0.69811320754717],["2012-10-01",0.75],["2012-11-01",0.688679245283019],["2012-12-01",0.64622641509434],["2013-01-01",0.556603773584906],["2013-02-01",0.622641509433962],["2013-03-01",0.641509433962264],["2013-04-01",0.617924528301887],["2013-05-01",0.617924528301887],["2013-06-01",0.613207547169811],["2013-07-01",0.575471698113208],["2013-08-01",0.589622641509434],["2013-09-01",0.589622641509434],["2013-10-01",0.580188679245283],["2013-11-01",0.617924528301887],["2013-12-01",0.627358490566038],["2014-01-01",0.537735849056604],["2014-02-01",0.561320754716981],["2014-03-01",0.556603773584906],["2014-04-01",0.55188679245283],["2014-05-01",0.5],["2014-06-01",0.462264150943396],["2014-07-01",0.429245283018868],["2014-08-01",0.419811320754717],["2014-09-01",0.443396226415094],["2014-10-01",0.452830188679245],["2014-11-01",0.424528301886792],["2014-12-01",0.419811320754717],["2015-01-01",0.433962264150943],["2015-02-01",0.419811320754717],["2015-03-01",0.377358490566038],["2015-04-01",0.35377358490566]]},{"name":"unemploy","data":[["2006-12-01",0.32185995105392],["2007-01-01",0.349806584037262],["2007-02-01",0.33488592405463],["2007-03-01",0.319412647035604],["2007-04-01",0.328807136654299],["2007-05-01",0.322175732217573],["2007-06-01",0.338991079182127],["2007-07-01",0.352411778637404],["2007-08-01",0.345938264782506],["2007-09-01",0.354069629746586],["2007-10-01",0.359358964237783],["2007-11-01",0.359595800110523],["2007-12-01",0.391568642930449],["2008-01-01",0.394726454566985],["2008-02-01",0.379884739875266],["2008-03-01",0.40554195942212],["2008-04-01",0.390937080603142],["2008-05-01",0.450777611115497],["2008-06-01",0.464987763479908],["2008-07-01",0.493565958790558],["2008-08-01",0.53311754953817],["2008-09-01",0.53753848582932],["2008-10-01",0.583326754559091],["2008-11-01",0.619957369542907],["2008-12-01",0.679008447146128],["2009-01-01",0.73995421173127],["2009-02-01",0.806268256098524],["2009-03-01",0.847951369700797],["2009-04-01",0.881661008920818],["2009-05-01",0.932659666850872],["2009-06-01",0.949080287360859],["2009-07-01",0.940712086524039],["2009-08-01",0.957527433488592],["2009-09-01",0.972921765216705],["2009-10-01",1],["2009-11-01",0.989500276308518],["2009-12-01",0.979947896107997],["2010-01-01",0.975842740980501],["2010-02-01",0.981132075471698],["2010-03-01",0.98815820636299],["2010-04-01",0.997868477145338],["2010-05-01",0.960290518670561],["2010-06-01",0.930686034578037],["2010-07-01",0.933685955632746],["2010-08-01",0.944422515196969],["2010-09-01",0.938975290123944],["2010-10-01",0.9340017367964],["2010-11-01",0.978605826162469],["2010-12-01",0.920738927922949],["2011-01-01",0.894292255466961],["2011-02-01",0.879055814320676],["2011-03-01",0.872503355174864],["2011-04-01",0.889871319175811],["2011-05-01",0.881818899502645],["2011-06-01",0.890266045630378],["2011-07-01",0.874555932738612],["2011-08-01",0.878897923738849],["2011-09-01",0.889160811557591],["2011-10-01",0.861214178574248],["2011-11-01",0.838162153627536],["2011-12-01",0.821662587826636],["2012-01-01",0.798294781716271],["2012-02-01",0.799557906370885],["2012-03-01",0.791663377279545],["2012-04-01",0.786374042788348],["2012-05-01",0.787479276861135],["2012-06-01",0.790005526170364],["2012-07-01",0.787163495697482],["2012-08-01",0.772558616878503],["2012-09-01",0.744454093313334],["2012-10-01",0.745164600931554],["2012-11-01",0.73577011131286],["2012-12-01",0.758901081550486],["2013-01-01",0.772558616878503],["2013-02-01",0.731428120312623],["2013-03-01",0.710823399384227],["2013-04-01",0.716428515039078],["2013-05-01",0.708060314202258],["2013-06-01",0.715718007420857],["2013-07-01",0.682876766400884],["2013-08-01",0.678455830109734],["2013-09-01",0.677745322491513],["2013-10-01",0.667166653509118],["2013-11-01",0.639614746980343],["2013-12-01",0.609378700560512],["2014-01-01",0.593431751796005],["2014-02-01",0.605036709560275],["2014-03-01",0.60748401357859],["2014-04-01",0.553959106339307],["2014-05-01",0.56635351701271],["2014-06-01",0.534854345938265],["2014-07-01",0.546538248993447],["2014-08-01",0.545827741375227],["2014-09-01",0.519223178337412],["2014-10-01",0.497750059208968],["2014-11-01",0.505644588300308],["2014-12-01",0.476197994789611],["2015-01-01",0.490881818899503],["2015-02-01",0.467750848661877],["2015-03-01",0.459382647825057],["2015-04-01",0.461119444225152]]}],"dataLabels":{"enabled":false},"stroke":{"curve":"straight"},"xaxis":{"type":"datetime"},"yaxis":{"decimalsInFloat":2}},"auto_update":true},"evals":[],"jsHooks":[]}</script><p>Create area charts with <code>type = "area"</code>:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" title="1"><span class="kw"><a href="../reference/apex.html">apex</a></span>(<span class="dt">data =</span> economics_long, <span class="dt">type =</span> <span class="st">"area"</span>, <span class="dt">mapping =</span> <span class="kw"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="dt">x =</span> date, <span class="dt">y =</span> value01, <span class="dt">fill =</span> variable)) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb8-2" title="2"><span class="st"> </span><span class="kw"><a href="../reference/ax_yaxis.html">ax_yaxis</a></span>(<span class="dt">decimalsInFloat =</span> <span class="dv">2</span>) <span class="op">%&gt;%</span><span class="st"> </span><span class="co"># number of decimals to keep</span></a>
<a class="sourceLine" id="cb8-3" title="3"><span class="st"> </span><span class="kw"><a href="../reference/ax_chart.html">ax_chart</a></span>(<span class="dt">stacked =</span> <span class="ot">TRUE</span>) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb8-4" title="4"><span class="st"> </span><span class="kw"><a href="../reference/ax_yaxis.html">ax_yaxis</a></span>(<span class="dt">max =</span> <span class="dv">4</span>, <span class="dt">tickAmount =</span> <span class="dv">4</span>)</a></code></pre></div>
<div id="htmlwidget-fe11cb6dc41c88139b0b" style="width:100%;height:350px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-fe11cb6dc41c88139b0b">{"x":{"ax_opts":{"chart":{"type":"area","stacked":true},"series":[{"name":"pce","data":[["2006-12-01",0.766854052759025],["2007-01-01",0.77090125009626],["2007-02-01",0.773510965081158],["2007-03-01",0.776788082586784],["2007-04-01",0.779406354014255],["2007-05-01",0.782452447570398],["2007-06-01",0.783821478382148],["2007-07-01",0.787440853590711],["2007-08-01",0.791231357650743],["2007-09-01",0.794996192383055],["2007-10-01",0.797486117171925],["2007-11-01",0.803544078513917],["2007-12-01",0.804451061426701],["2008-01-01",0.806299253022563],["2008-02-01",0.804878883555373],["2008-03-01",0.808814847139153],["2008-04-01",0.812014956661618],["2008-05-01",0.816892128928477],["2008-06-01",0.821521164360705],["2008-07-01",0.821247358198356],["2008-08-01",0.820391713941012],["2008-09-01",0.816010815343413],["2008-10-01",0.808891855122314],["2008-11-01",0.796955617732372],["2008-12-01",0.789246262973706],["2009-01-01",0.7937897339802],["2009-02-01",0.792266687202129],["2009-03-01",0.788202376979747],["2009-04-01",0.788741432861873],["2009-05-01",0.790803535522071],["2009-06-01",0.795766272214664],["2009-07-01",0.79874391423022],["2009-08-01",0.808951750220328],["2009-09-01",0.802311950783342],["2009-10-01",0.806461825431459],["2009-11-01",0.807197679492774],["2009-12-01",0.81219464195566],["2010-01-01",0.81244277879029],["2010-02-01",0.81490703425144],["2010-03-01",0.8199125531569],["2010-04-01",0.821948986489377],["2010-05-01",0.823497702595169],["2010-06-01",0.82524321688015],["2010-07-01",0.828092512257104],["2010-08-01",0.831814564776549],["2010-09-01",0.833594304831823],["2010-10-01",0.838360243345227],["2010-11-01",0.842638464631945],["2010-12-01",0.84583857415441],["2011-01-01",0.849552070231281],["2011-02-01",0.852512599361689],["2011-03-01",0.859391979190732],["2011-04-01",0.862566419385476],["2011-05-01",0.864654191373395],["2011-06-01",0.866776189131607],["2011-07-01",0.870258661258995],["2011-08-01",0.872235199493459],["2011-09-01",0.875443865458497],["2011-10-01",0.876727331844512],["2011-11-01",0.877274944169212],["2011-12-01",0.878361612376039],["2012-01-01",0.886053854249557],["2012-02-01",0.893874442761677],["2012-03-01",0.893728983237929],["2012-04-01",0.896116230715918],["2012-05-01",0.895166465590266],["2012-06-01",0.89325837889639],["2012-07-01",0.895902319651582],["2012-08-01",0.898204002703836],["2012-09-01",0.903115400740988],["2012-10-01",0.906392518246614],["2012-11-01",0.909558401998785],["2012-12-01",0.909874990374002],["2013-01-01",0.915205654097253],["2013-02-01",0.918354424964277],["2013-03-01",0.917284869642597],["2013-04-01",0.915428121604162],["2013-05-01",0.918782247092949],["2013-06-01",0.92085290619572],["2013-07-01",0.923240153673709],["2013-08-01",0.926020997510075],["2013-09-01",0.92924677636026],["2013-10-01",0.933773134481608],["2013-11-01",0.939574402546397],["2013-12-01",0.942167004646148],["2014-01-01",0.941704956747183],["2014-02-01",0.946299766409118],["2014-03-01",0.952871114305516],["2014-04-01",0.957970754079284],["2014-05-01",0.961889604777918],["2014-06-01",0.967759324383294],["2014-07-01",0.971481376902739],["2014-08-01",0.978651675779278],["2014-09-01",0.979772569756398],["2014-10-01",0.985385596084572],["2014-11-01",0.987815625775428],["2014-12-01",0.988722608688212],["2015-01-01",0.987353577876462],["2015-02-01",0.990468122973193],["2015-03-01",0.99696246288643],["2015-04-01",1]]},{"name":"pop","data":[["2006-12-01",0.835136442063848],["2007-01-01",0.8370593562946],["2007-02-01",0.838932965032257],["2007-03-01",0.840732615530269],["2007-04-01",0.842647312178839],["2007-05-01",0.844529138498678],["2007-06-01",0.84663283953745],["2007-07-01",0.848810498815867],["2007-08-01",0.850971722929918],["2007-09-01",0.853264428358893],["2007-10-01",0.855409217308578],["2007-11-01",0.857438960107706],["2007-12-01",0.859353656756276],["2008-01-01",0.861153307254289],["2008-02-01",0.862837911601743],["2008-03-01",0.864448557709553],["2008-04-01",0.866174249967921],["2008-05-01",0.867867071897558],["2008-06-01",0.869781768546128],["2008-07-01",0.871770423434342],["2008-08-01",0.87380016623347],["2008-09-01",0.875969607929704],["2008-10-01",0.877982915564467],["2008-11-01",0.879889394630854],["2008-12-01",0.881680827546683],["2009-01-01",0.883357214311955],["2009-02-01",0.884951425255399],["2009-03-01",0.886479895541382],["2009-04-01",0.888115194395741],["2009-05-01",0.889734058085733],["2009-06-01",0.891558361330294],["2009-07-01",0.893473057978864],["2009-08-01",0.895494583195809],["2009-09-01",0.897639372145494],["2009-10-01",0.899636244615892],["2009-11-01",0.901518070935731],["2009-12-01",0.903284851105012],["2010-01-01",0.904928367541553],["2010-02-01",0.906522578484998],["2010-03-01",0.908042831188798],["2010-04-01",0.907871995872802],["2010-05-01",0.909333427123338],["2010-06-01",0.910808064028442],["2010-07-01",0.912428538364542],["2010-08-01",0.914171298541104],["2010-09-01",0.915968409806222],["2010-10-01",0.917804973683399],["2010-11-01",0.919414025580265],["2010-12-01",0.920942011028899],["2011-01-01",0.92241324585498],["2011-02-01",0.923667544729019],["2011-03-01",0.924916847313091],["2011-04-01",0.926320689747691],["2011-05-01",0.927724597922949],["2011-06-01",0.929237808158818],["2011-07-01",0.930929200229156],["2011-08-01",0.932641070514292],["2011-09-01",0.934479762745255],["2011-10-01",0.936246879835405],["2011-11-01",0.93777012373912],["2011-12-01",0.939250841655039],["2012-01-01",0.940676320983526],["2012-02-01",0.941956603852427],["2012-03-01",0.943274638293876],["2012-04-01",0.944653203445681],["2012-05-01",0.945995981027082],["2012-06-01",0.947533194820507],["2012-07-01",0.949120765957549],["2012-08-01",0.95085923655621],["2012-09-01",0.952703327738667],["2012-10-01",0.954406249076806],["2012-11-01",0.956048820491396],["2012-12-01",0.957518855550477],["2013-01-01",0.958807725792759],["2013-02-01",0.959880514711547],["2013-03-01",0.961048077005648],["2013-04-01",0.962326987538324],["2013-05-01",0.963689454446634],["2013-06-01",0.965229330736687],["2013-07-01",0.966772066745339],["2013-08-01",0.968592663860335],["2013-09-01",0.970448177482025],["2013-10-01",0.972224366782906],["2013-11-01",0.97391518362249],["2013-12-01",0.975423315392571],["2014-01-01",0.976921972290395],["2014-02-01",0.97823645673634],["2014-03-01",0.97957855225842],["2014-04-01",0.980992099657577],["2014-05-01",0.982473622896551],["2014-06-01",0.984073150615668],["2014-07-01",0.985702006885595],["2014-08-01",0.987603703319152],["2014-09-01",0.989506155770269],["2014-10-01",0.991383363808922],["2014-11-01",0.993112959418826],["2014-12-01",0.994608132061805],["2015-01-01",0.996107750416745],["2015-02-01",0.997306408041825],["2015-03-01",0.998590610697427],["2015-04-01",1]]},{"name":"psavert","data":[["2006-12-01",0.0993377483443709],["2007-01-01",0.0993377483443709],["2007-02-01",0.125827814569536],["2007-03-01",0.145695364238411],["2007-04-01",0.132450331125828],["2007-05-01",0.119205298013245],["2007-06-01",0.105960264900662],["2007-07-01",0.0993377483443709],["2007-08-01",0.0794701986754967],["2007-09-01",0.0860927152317881],["2007-10-01",0.0794701986754967],["2007-11-01",0.0596026490066225],["2007-12-01",0.0927152317880795],["2008-01-01",0.0993377483443709],["2008-02-01",0.125827814569536],["2008-03-01",0.119205298013245],["2008-04-01",0.0794701986754967],["2008-05-01",0.370860927152318],["2008-06-01",0.218543046357616],["2008-07-01",0.145695364238411],["2008-08-01",0.105960264900662],["2008-09-01",0.165562913907285],["2008-10-01",0.218543046357616],["2008-11-01",0.278145695364238],["2008-12-01",0.278145695364238],["2009-01-01",0.264900662251656],["2009-02-01",0.218543046357616],["2009-03-01",0.245033112582781],["2009-04-01",0.304635761589404],["2009-05-01",0.397350993377483],["2009-06-01",0.298013245033113],["2009-07-01",0.251655629139073],["2009-08-01",0.178807947019868],["2009-09-01",0.245033112582781],["2009-10-01",0.211920529801325],["2009-11-01",0.245033112582781],["2009-12-01",0.245033112582781],["2010-01-01",0.258278145695364],["2010-02-01",0.23841059602649],["2010-03-01",0.231788079470199],["2010-04-01",0.278145695364238],["2010-05-01",0.317880794701987],["2010-06-01",0.311258278145695],["2010-07-01",0.304635761589404],["2010-08-01",0.311258278145695],["2010-09-01",0.298013245033113],["2010-10-01",0.291390728476821],["2010-11-01",0.291390728476821],["2010-12-01",0.324503311258278],["2011-01-01",0.344370860927152],["2011-02-01",0.357615894039735],["2011-03-01",0.317880794701987],["2011-04-01",0.311258278145695],["2011-05-01",0.311258278145695],["2011-06-01",0.33112582781457],["2011-07-01",0.337748344370861],["2011-08-01",0.33112582781457],["2011-09-01",0.304635761589404],["2011-10-01",0.304635761589404],["2011-11-01",0.317880794701987],["2011-12-01",0.370860927152318],["2012-01-01",0.384105960264901],["2012-02-01",0.384105960264901],["2012-03-01",0.417218543046358],["2012-04-01",0.43046357615894],["2012-05-01",0.437086092715232],["2012-06-01",0.456953642384106],["2012-07-01",0.397350993377483],["2012-08-01",0.384105960264901],["2012-09-01",0.397350993377483],["2012-10-01",0.437086092715232],["2012-11-01",0.496688741721854],["2012-12-01",0.649006622516556],["2013-01-01",0.271523178807947],["2013-02-01",0.23841059602649],["2013-03-01",0.245033112582781],["2013-04-01",0.278145695364238],["2013-05-01",0.298013245033113],["2013-06-01",0.304635761589404],["2013-07-01",0.291390728476821],["2013-08-01",0.298013245033113],["2013-09-01",0.304635761589404],["2013-10-01",0.271523178807947],["2013-11-01",0.264900662251656],["2013-12-01",0.278145695364238],["2014-01-01",0.324503311258278],["2014-02-01",0.337748344370861],["2014-03-01",0.344370860927152],["2014-04-01",0.344370860927152],["2014-05-01",0.344370860927152],["2014-06-01",0.344370860927152],["2014-07-01",0.350993377483444],["2014-08-01",0.33112582781457],["2014-09-01",0.344370860927152],["2014-10-01",0.33112582781457],["2014-11-01",0.337748344370861],["2014-12-01",0.357615894039735],["2015-01-01",0.364238410596026],["2015-02-01",0.377483443708609],["2015-03-01",0.344370860927152],["2015-04-01",0.357615894039735]]},{"name":"uempmed","data":[["2006-12-01",0.165094339622642],["2007-01-01",0.202830188679245],["2007-02-01",0.212264150943396],["2007-03-01",0.240566037735849],["2007-04-01",0.216981132075472],["2007-05-01",0.19811320754717],["2007-06-01",0.174528301886792],["2007-07-01",0.221698113207547],["2007-08-01",0.226415094339623],["2007-09-01",0.221698113207547],["2007-10-01",0.207547169811321],["2007-11-01",0.216981132075472],["2007-12-01",0.207547169811321],["2008-01-01",0.235849056603774],["2008-02-01",0.221698113207547],["2008-03-01",0.221698113207547],["2008-04-01",0.254716981132075],["2008-05-01",0.183962264150943],["2008-06-01",0.235849056603774],["2008-07-01",0.268867924528302],["2008-08-01",0.268867924528302],["2008-09-01",0.292452830188679],["2008-10-01",0.30188679245283],["2008-11-01",0.273584905660377],["2008-12-01",0.306603773584906],["2009-01-01",0.316037735849057],["2009-02-01",0.363207547169811],["2009-03-01",0.391509433962264],["2009-04-01",0.429245283018868],["2009-05-01",0.481132075471698],["2009-06-01",0.622641509433962],["2009-07-01",0.566037735849057],["2009-08-01",0.580188679245283],["2009-09-01",0.650943396226415],["2009-10-01",0.702830188679245],["2009-11-01",0.745283018867925],["2009-12-01",0.759433962264151],["2010-01-01",0.754716981132076],["2010-02-01",0.75],["2010-03-01",0.773584905660377],["2010-04-01",0.85377358490566],["2010-05-01",0.863207547169811],["2010-06-01",1],["2010-07-01",0.863207547169811],["2010-08-01",0.80188679245283],["2010-09-01",0.768867924528302],["2010-10-01",0.811320754716981],["2010-11-01",0.80188679245283],["2010-12-01",0.844339622641509],["2011-01-01",0.825471698113208],["2011-02-01",0.806603773584906],["2011-03-01",0.825471698113208],["2011-04-01",0.797169811320755],["2011-05-01",0.830188679245283],["2011-06-01",0.867924528301887],["2011-07-01",0.849056603773585],["2011-08-01",0.867924528301887],["2011-09-01",0.849056603773585],["2011-10-01",0.783018867924528],["2011-11-01",0.792452830188679],["2011-12-01",0.778301886792453],["2012-01-01",0.792452830188679],["2012-02-01",0.740566037735849],["2012-03-01",0.716981132075472],["2012-04-01",0.712264150943396],["2012-05-01",0.75],["2012-06-01",0.773584905660377],["2012-07-01",0.636792452830189],["2012-08-01",0.679245283018868],["2012-09-01",0.69811320754717],["2012-10-01",0.75],["2012-11-01",0.688679245283019],["2012-12-01",0.64622641509434],["2013-01-01",0.556603773584906],["2013-02-01",0.622641509433962],["2013-03-01",0.641509433962264],["2013-04-01",0.617924528301887],["2013-05-01",0.617924528301887],["2013-06-01",0.613207547169811],["2013-07-01",0.575471698113208],["2013-08-01",0.589622641509434],["2013-09-01",0.589622641509434],["2013-10-01",0.580188679245283],["2013-11-01",0.617924528301887],["2013-12-01",0.627358490566038],["2014-01-01",0.537735849056604],["2014-02-01",0.561320754716981],["2014-03-01",0.556603773584906],["2014-04-01",0.55188679245283],["2014-05-01",0.5],["2014-06-01",0.462264150943396],["2014-07-01",0.429245283018868],["2014-08-01",0.419811320754717],["2014-09-01",0.443396226415094],["2014-10-01",0.452830188679245],["2014-11-01",0.424528301886792],["2014-12-01",0.419811320754717],["2015-01-01",0.433962264150943],["2015-02-01",0.419811320754717],["2015-03-01",0.377358490566038],["2015-04-01",0.35377358490566]]},{"name":"unemploy","data":[["2006-12-01",0.32185995105392],["2007-01-01",0.349806584037262],["2007-02-01",0.33488592405463],["2007-03-01",0.319412647035604],["2007-04-01",0.328807136654299],["2007-05-01",0.322175732217573],["2007-06-01",0.338991079182127],["2007-07-01",0.352411778637404],["2007-08-01",0.345938264782506],["2007-09-01",0.354069629746586],["2007-10-01",0.359358964237783],["2007-11-01",0.359595800110523],["2007-12-01",0.391568642930449],["2008-01-01",0.394726454566985],["2008-02-01",0.379884739875266],["2008-03-01",0.40554195942212],["2008-04-01",0.390937080603142],["2008-05-01",0.450777611115497],["2008-06-01",0.464987763479908],["2008-07-01",0.493565958790558],["2008-08-01",0.53311754953817],["2008-09-01",0.53753848582932],["2008-10-01",0.583326754559091],["2008-11-01",0.619957369542907],["2008-12-01",0.679008447146128],["2009-01-01",0.73995421173127],["2009-02-01",0.806268256098524],["2009-03-01",0.847951369700797],["2009-04-01",0.881661008920818],["2009-05-01",0.932659666850872],["2009-06-01",0.949080287360859],["2009-07-01",0.940712086524039],["2009-08-01",0.957527433488592],["2009-09-01",0.972921765216705],["2009-10-01",1],["2009-11-01",0.989500276308518],["2009-12-01",0.979947896107997],["2010-01-01",0.975842740980501],["2010-02-01",0.981132075471698],["2010-03-01",0.98815820636299],["2010-04-01",0.997868477145338],["2010-05-01",0.960290518670561],["2010-06-01",0.930686034578037],["2010-07-01",0.933685955632746],["2010-08-01",0.944422515196969],["2010-09-01",0.938975290123944],["2010-10-01",0.9340017367964],["2010-11-01",0.978605826162469],["2010-12-01",0.920738927922949],["2011-01-01",0.894292255466961],["2011-02-01",0.879055814320676],["2011-03-01",0.872503355174864],["2011-04-01",0.889871319175811],["2011-05-01",0.881818899502645],["2011-06-01",0.890266045630378],["2011-07-01",0.874555932738612],["2011-08-01",0.878897923738849],["2011-09-01",0.889160811557591],["2011-10-01",0.861214178574248],["2011-11-01",0.838162153627536],["2011-12-01",0.821662587826636],["2012-01-01",0.798294781716271],["2012-02-01",0.799557906370885],["2012-03-01",0.791663377279545],["2012-04-01",0.786374042788348],["2012-05-01",0.787479276861135],["2012-06-01",0.790005526170364],["2012-07-01",0.787163495697482],["2012-08-01",0.772558616878503],["2012-09-01",0.744454093313334],["2012-10-01",0.745164600931554],["2012-11-01",0.73577011131286],["2012-12-01",0.758901081550486],["2013-01-01",0.772558616878503],["2013-02-01",0.731428120312623],["2013-03-01",0.710823399384227],["2013-04-01",0.716428515039078],["2013-05-01",0.708060314202258],["2013-06-01",0.715718007420857],["2013-07-01",0.682876766400884],["2013-08-01",0.678455830109734],["2013-09-01",0.677745322491513],["2013-10-01",0.667166653509118],["2013-11-01",0.639614746980343],["2013-12-01",0.609378700560512],["2014-01-01",0.593431751796005],["2014-02-01",0.605036709560275],["2014-03-01",0.60748401357859],["2014-04-01",0.553959106339307],["2014-05-01",0.56635351701271],["2014-06-01",0.534854345938265],["2014-07-01",0.546538248993447],["2014-08-01",0.545827741375227],["2014-09-01",0.519223178337412],["2014-10-01",0.497750059208968],["2014-11-01",0.505644588300308],["2014-12-01",0.476197994789611],["2015-01-01",0.490881818899503],["2015-02-01",0.467750848661877],["2015-03-01",0.459382647825057],["2015-04-01",0.461119444225152]]}],"dataLabels":{"enabled":false},"stroke":{"curve":"straight"},"xaxis":{"type":"datetime"},"yaxis":{"decimalsInFloat":2,"tickAmount":4,"max":4}},"auto_update":true},"evals":[],"jsHooks":[]}</script>
</div>
<div id="scatter-charts" class="section level2">
<h2 class="hasAnchor">
<a href="#scatter-charts" class="anchor"></a>Scatter charts</h2>
<p>Simple bar charts can be created with:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" title="1"><span class="kw"><a href="../reference/apex.html">apex</a></span>(<span class="dt">data =</span> mtcars, <span class="dt">type =</span> <span class="st">"scatter"</span>, <span class="dt">mapping =</span> <span class="kw"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="dt">x =</span> wt, <span class="dt">y =</span> mpg))</a></code></pre></div>
<div id="htmlwidget-9f8b9b2c643857bf78a5" style="width:100%;height:350px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-9f8b9b2c643857bf78a5">{"x":{"ax_opts":{"chart":{"type":"scatter"},"series":[{"name":"mpg","data":[{"x":2.62,"y":21},{"x":2.875,"y":21},{"x":2.32,"y":22.8},{"x":3.215,"y":21.4},{"x":3.44,"y":18.7},{"x":3.46,"y":18.1},{"x":3.57,"y":14.3},{"x":3.19,"y":24.4},{"x":3.15,"y":22.8},{"x":3.44,"y":19.2},{"x":3.44,"y":17.8},{"x":4.07,"y":16.4},{"x":3.73,"y":17.3},{"x":3.78,"y":15.2},{"x":5.25,"y":10.4},{"x":5.424,"y":10.4},{"x":5.345,"y":14.7},{"x":2.2,"y":32.4},{"x":1.615,"y":30.4},{"x":1.835,"y":33.9},{"x":2.465,"y":21.5},{"x":3.52,"y":15.5},{"x":3.435,"y":15.2},{"x":3.84,"y":13.3},{"x":3.845,"y":19.2},{"x":1.935,"y":27.3},{"x":2.14,"y":26},{"x":1.513,"y":30.4},{"x":3.17,"y":15.8},{"x":2.77,"y":19.7},{"x":3.57,"y":15},{"x":2.78,"y":21.4}]}],"xaxis":{"min":1,"max":6},"yaxis":{"min":10,"max":35}},"auto_update":true},"evals":[],"jsHooks":[]}</script><p>Color points according to a third variable:</p>
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" title="1"><span class="kw"><a href="../reference/apex.html">apex</a></span>(<span class="dt">data =</span> mtcars, <span class="dt">type =</span> <span class="st">"scatter"</span>, <span class="dt">mapping =</span> <span class="kw"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="dt">x =</span> wt, <span class="dt">y =</span> mpg, <span class="dt">fill =</span> cyl)) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb10-2" title="2"><span class="st"> </span><span class="kw"><a href="../reference/ax_xaxis.html">ax_xaxis</a></span>(<span class="dt">tickAmount =</span> <span class="dv">5</span>)</a></code></pre></div>
<div id="htmlwidget-e4eaf7e0f849bd1d98d1" style="width:100%;height:350px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-e4eaf7e0f849bd1d98d1">{"x":{"ax_opts":{"chart":{"type":"scatter"},"series":[{"name":6,"data":[{"x":2.62,"y":21},{"x":2.875,"y":21},{"x":3.215,"y":21.4},{"x":3.46,"y":18.1},{"x":3.44,"y":19.2},{"x":3.44,"y":17.8},{"x":2.77,"y":19.7}]},{"name":4,"data":[{"x":2.32,"y":22.8},{"x":3.19,"y":24.4},{"x":3.15,"y":22.8},{"x":2.2,"y":32.4},{"x":1.615,"y":30.4},{"x":1.835,"y":33.9},{"x":2.465,"y":21.5},{"x":1.935,"y":27.3},{"x":2.14,"y":26},{"x":1.513,"y":30.4},{"x":2.78,"y":21.4}]},{"name":8,"data":[{"x":3.44,"y":18.7},{"x":3.57,"y":14.3},{"x":4.07,"y":16.4},{"x":3.73,"y":17.3},{"x":3.78,"y":15.2},{"x":5.25,"y":10.4},{"x":5.424,"y":10.4},{"x":5.345,"y":14.7},{"x":3.52,"y":15.5},{"x":3.435,"y":15.2},{"x":3.84,"y":13.3},{"x":3.845,"y":19.2},{"x":3.17,"y":15.8},{"x":3.57,"y":15}]}],"xaxis":{"min":1,"max":6,"tickAmount":5},"yaxis":{"min":10,"max":35}},"auto_update":true},"evals":[],"jsHooks":[]}</script><p>And change point size using <code>z</code> aesthetics:</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb11-1" title="1"><span class="kw"><a href="../reference/apex.html">apex</a></span>(<span class="dt">data =</span> mtcars, <span class="dt">type =</span> <span class="st">"scatter"</span>, <span class="dt">mapping =</span> <span class="kw"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="dt">x =</span> wt, <span class="dt">y =</span> mpg, <span class="dt">z =</span> scales<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/scales/topics/rescale">rescale</a></span>(qsec)))</a></code></pre></div>
<div id="htmlwidget-1805e18e85b3512bb885" style="width:100%;height:350px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-1805e18e85b3512bb885">{"x":{"ax_opts":{"chart":{"type":"scatter"},"series":[{"name":"mpg","data":[{"x":2.62,"y":21,"z":0.233333333333333},{"x":2.875,"y":21,"z":0.3},{"x":2.32,"y":22.8,"z":0.489285714285714},{"x":3.215,"y":21.4,"z":0.588095238095238},{"x":3.44,"y":18.7,"z":0.3},{"x":3.46,"y":18.1,"z":0.680952380952381},{"x":3.57,"y":14.3,"z":0.15952380952381},{"x":3.19,"y":24.4,"z":0.654761904761905},{"x":3.15,"y":22.8,"z":1},{"x":3.44,"y":19.2,"z":0.452380952380953},{"x":3.44,"y":17.8,"z":0.523809523809524},{"x":4.07,"y":16.4,"z":0.345238095238095},{"x":3.73,"y":17.3,"z":0.369047619047619},{"x":3.78,"y":15.2,"z":0.416666666666667},{"x":5.25,"y":10.4,"z":0.414285714285714},{"x":5.424,"y":10.4,"z":0.395238095238095},{"x":5.345,"y":14.7,"z":0.347619047619048},{"x":2.2,"y":32.4,"z":0.591666666666667},{"x":1.615,"y":30.4,"z":0.478571428571429},{"x":1.835,"y":33.9,"z":0.642857142857143},{"x":2.465,"y":21.5,"z":0.655952380952381},{"x":3.52,"y":15.5,"z":0.282142857142857},{"x":3.435,"y":15.2,"z":0.333333333333333},{"x":3.84,"y":13.3,"z":0.108333333333333},{"x":3.845,"y":19.2,"z":0.303571428571429},{"x":1.935,"y":27.3,"z":0.523809523809524},{"x":2.14,"y":26,"z":0.261904761904762},{"x":1.513,"y":30.4,"z":0.285714285714286},{"x":3.17,"y":15.8,"z":0},{"x":2.77,"y":19.7,"z":0.119047619047619},{"x":3.57,"y":15,"z":0.0119047619047619},{"x":2.78,"y":21.4,"z":0.488095238095238}]}],"xaxis":{"min":1,"max":6},"yaxis":{"min":10,"max":35}},"auto_update":true},"evals":[],"jsHooks":[]}</script>
</div>
<div id="pie-charts" class="section level2">
<h2 class="hasAnchor">
<a href="#pie-charts" class="anchor"></a>Pie charts</h2>
<p>Simple pie charts can be created with:</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" title="1">poll &lt;-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/data.frame">data.frame</a></span>(</a>
<a class="sourceLine" id="cb12-2" title="2"> <span class="dt">answer =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="st">"Yes"</span>, <span class="st">"No"</span>),</a>
<a class="sourceLine" id="cb12-3" title="3"> <span class="dt">n =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">254</span>, <span class="dv">238</span>)</a>
<a class="sourceLine" id="cb12-4" title="4">)</a>
<a class="sourceLine" id="cb12-5" title="5"></a>
<a class="sourceLine" id="cb12-6" title="6"><span class="kw"><a href="../reference/apex.html">apex</a></span>(<span class="dt">data =</span> poll, <span class="dt">type =</span> <span class="st">"pie"</span>, <span class="dt">mapping =</span> <span class="kw"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="dt">x =</span> answer, <span class="dt">y =</span> n))</a></code></pre></div>
<div id="htmlwidget-81af3daf777fbf123b48" style="width:100%;height:350px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-81af3daf777fbf123b48">{"x":{"ax_opts":{"chart":{"type":"pie"},"series":[254,238],"labels":["Yes","No"]},"auto_update":true},"evals":[],"jsHooks":[]}</script>
</div>
<div id="radial-charts" class="section level2">
<h2 class="hasAnchor">
<a href="#radial-charts" class="anchor"></a>Radial charts</h2>
<p>Simple radial charts can be created with (here we pass values directly in <code>aes</code>, but you can use a <code>data.frame</code>) :</p>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb13-1" title="1"><span class="kw"><a href="../reference/apex.html">apex</a></span>(<span class="dt">data =</span> <span class="ot">NULL</span>, <span class="dt">type =</span> <span class="st">"radialBar"</span>, <span class="dt">mapping =</span> <span class="kw"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="dt">x =</span> <span class="st">"My value"</span>, <span class="dt">y =</span> <span class="dv">65</span>))</a></code></pre></div>
<div id="htmlwidget-15e4edbe3e240757d505" style="width:100%;height:350px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-15e4edbe3e240757d505">{"x":{"ax_opts":{"chart":{"type":"radialBar"},"series":[65],"labels":["My value"]},"auto_update":true},"evals":[],"jsHooks":[]}</script><p>Multi radial chart (more than one value):</p>
<div class="sourceCode" id="cb14"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb14-1" title="1">fruits &lt;-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/data.frame">data.frame</a></span>(</a>
<a class="sourceLine" id="cb14-2" title="2"> <span class="dt">name =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="st">'Apples'</span>, <span class="st">'Oranges'</span>, <span class="st">'Bananas'</span>, <span class="st">'Berries'</span>),</a>
<a class="sourceLine" id="cb14-3" title="3"> <span class="dt">value =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">44</span>, <span class="dv">55</span>, <span class="dv">67</span>, <span class="dv">83</span>)</a>
<a class="sourceLine" id="cb14-4" title="4">)</a>
<a class="sourceLine" id="cb14-5" title="5"></a>
<a class="sourceLine" id="cb14-6" title="6"><span class="kw"><a href="../reference/apex.html">apex</a></span>(<span class="dt">data =</span> fruits, <span class="dt">type =</span> <span class="st">"radialBar"</span>, <span class="dt">mapping =</span> <span class="kw"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="dt">x =</span> name, <span class="dt">y =</span> value))</a></code></pre></div>
<div id="htmlwidget-199f13fc0e363b87d5c1" style="width:100%;height:350px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-199f13fc0e363b87d5c1">{"x":{"ax_opts":{"chart":{"type":"radialBar"},"series":[44,55,67,83],"labels":["Apples","Oranges","Bananas","Berries"]},"auto_update":true},"evals":[],"jsHooks":[]}</script>
</div>
<div id="radar-charts" class="section level2">
<h2 class="hasAnchor">
<a href="#radar-charts" class="anchor"></a>Radar charts</h2>
<p>Simple radar charts can be created with:</p>
<div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb15-1" title="1">mtcars<span class="op">$</span>model &lt;-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/colnames">rownames</a></span>(mtcars)</a>
<a class="sourceLine" id="cb15-2" title="2"></a>
<a class="sourceLine" id="cb15-3" title="3"><span class="kw"><a href="../reference/apex.html">apex</a></span>(<span class="dt">data =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/head">head</a></span>(mtcars), <span class="dt">type =</span> <span class="st">"radar"</span>, <span class="dt">mapping =</span> <span class="kw"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="dt">x =</span> model, <span class="dt">y =</span> qsec))</a></code></pre></div>
<div id="htmlwidget-894c07e4e8b30b44831a" style="width:100%;height:350px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-894c07e4e8b30b44831a">{"x":{"ax_opts":{"chart":{"type":"radar"},"series":[{"name":"qsec","data":[{"x":"Mazda RX4","y":16.46},{"x":"Mazda RX4 Wag","y":17.02},{"x":"Datsun 710","y":18.61},{"x":"Hornet 4 Drive","y":19.44},{"x":"Hornet Sportabout","y":17.02},{"x":"Valiant","y":20.22}]}]},"auto_update":true},"evals":[],"jsHooks":[]}</script><p>With a grouping variable:</p>
<div class="sourceCode" id="cb16"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb16-1" title="1"><span class="co"># extremely complicated reshaping</span></a>
<a class="sourceLine" id="cb16-2" title="2">new_mtcars &lt;-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/stats/topics/reshape">reshape</a></span>(</a>
<a class="sourceLine" id="cb16-3" title="3"> <span class="dt">data =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/head">head</a></span>(mtcars), </a>
<a class="sourceLine" id="cb16-4" title="4"> <span class="dt">idvar =</span> <span class="st">"model"</span>, </a>
<a class="sourceLine" id="cb16-5" title="5"> <span class="dt">varying =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="st">"drat"</span>, <span class="st">"wt"</span>)),</a>
<a class="sourceLine" id="cb16-6" title="6"> <span class="dt">times =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="st">"drat"</span>, <span class="st">"wt"</span>),</a>
<a class="sourceLine" id="cb16-7" title="7"> <span class="dt">direction =</span> <span class="st">"long"</span>,</a>
<a class="sourceLine" id="cb16-8" title="8"> <span class="dt">v.names =</span> <span class="st">"value"</span>,</a>
<a class="sourceLine" id="cb16-9" title="9"> <span class="dt">drop =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="st">"mpg"</span>, <span class="st">"cyl"</span>, <span class="st">"hp"</span>, <span class="st">"dist"</span>, <span class="st">"qsec"</span>, <span class="st">"vs"</span>, <span class="st">"am"</span>, <span class="st">"gear"</span>, <span class="st">"carb"</span>)</a>
<a class="sourceLine" id="cb16-10" title="10">)</a>
<a class="sourceLine" id="cb16-11" title="11"></a>
<a class="sourceLine" id="cb16-12" title="12"><span class="kw"><a href="../reference/apex.html">apex</a></span>(<span class="dt">data =</span> new_mtcars, <span class="dt">type =</span> <span class="st">"radar"</span>, <span class="dt">mapping =</span> <span class="kw"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="dt">x =</span> model, <span class="dt">y =</span> value, <span class="dt">group =</span> time))</a></code></pre></div>
<div id="htmlwidget-01c461175d41355f75e5" style="width:100%;height:350px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-01c461175d41355f75e5">{"x":{"ax_opts":{"chart":{"type":"radar"},"series":[{"name":"drat","data":[{"x":"Mazda RX4","y":3.9},{"x":"Mazda RX4 Wag","y":3.9},{"x":"Datsun 710","y":3.85},{"x":"Hornet 4 Drive","y":3.08},{"x":"Hornet Sportabout","y":3.15},{"x":"Valiant","y":2.76}]},{"name":"wt","data":[{"x":"Mazda RX4","y":2.62},{"x":"Mazda RX4 Wag","y":2.875},{"x":"Datsun 710","y":2.32},{"x":"Hornet 4 Drive","y":3.215},{"x":"Hornet Sportabout","y":3.44},{"x":"Valiant","y":3.46}]}]},"auto_update":true},"evals":[],"jsHooks":[]}</script>
</div>
<div id="heatmap" class="section level2">
<h2 class="hasAnchor">
<a href="#heatmap" class="anchor"></a>Heatmap</h2>
<p>Create heatmap with :</p>
<div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb17-1" title="1">txhousing2 &lt;-<span class="st"> </span>txhousing <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb17-2" title="2"><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/stats/topics/filter">filter</a></span>(city <span class="op">%in%</span><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/head">head</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/unique">unique</a></span>(city)), year <span class="op">%in%</span><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">2000</span>, <span class="dv">2001</span>)) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb17-3" title="3"><span class="st"> </span><span class="kw">rename</span>(<span class="dt">val_med =</span> median)</a>
<a class="sourceLine" id="cb17-4" title="4"></a>
<a class="sourceLine" id="cb17-5" title="5"><span class="kw"><a href="../reference/apex.html">apex</a></span>(</a>
<a class="sourceLine" id="cb17-6" title="6"> <span class="dt">data =</span> txhousing2,</a>
<a class="sourceLine" id="cb17-7" title="7"> <span class="dt">type =</span> <span class="st">"heatmap"</span>, </a>
<a class="sourceLine" id="cb17-8" title="8"> <span class="dt">mapping =</span> <span class="kw"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="dt">x =</span> date, <span class="dt">y =</span> city, <span class="dt">fill =</span> scales<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/scales/topics/rescale">rescale</a></span>(val_med))</a>
<a class="sourceLine" id="cb17-9" title="9">) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb17-10" title="10"><span class="st"> </span><span class="kw"><a href="../reference/ax_dataLabels.html">ax_dataLabels</a></span>(<span class="dt">enabled =</span> <span class="ot">FALSE</span>) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb17-11" title="11"><span class="st"> </span><span class="kw"><a href="../reference/ax_colors.html">ax_colors</a></span>(<span class="st">"#008FFB"</span>)</a></code></pre></div>
<div id="htmlwidget-64c1eb49c4ea671fc6c6" style="width:100%;height:350px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-64c1eb49c4ea671fc6c6">{"x":{"ax_opts":{"chart":{"type":"heatmap"},"series":[{"name":"Abilene","data":[{"x":2000,"y":0.136270491803279},{"x":2000.08333333333,"y":0.00614754098360656},{"x":2000.16666666667,"y":0},{"x":2000.25,"y":0.107581967213115},{"x":2000.33333333333,"y":0.0942622950819672},{"x":2000.41666666667,"y":0.0901639344262295},{"x":2000.5,"y":0.157786885245902},{"x":2000.58333333333,"y":0.173155737704918},{"x":2000.66666666667,"y":0.0655737704918033},{"x":2000.75,"y":0.0122950819672131},{"x":2000.83333333333,"y":0.131147540983607},{"x":2000.91666666667,"y":0.0706967213114754},{"x":2001,"y":0.0655737704918033},{"x":2001.08333333333,"y":0.110655737704918},{"x":2001.16666666667,"y":0.145491803278689},{"x":2001.25,"y":0.137295081967213},{"x":2001.33333333333,"y":0.132172131147541},{"x":2001.41666666667,"y":0.204918032786885},{"x":2001.5,"y":0.293032786885246},{"x":2001.58333333333,"y":0.111680327868852},{"x":2001.66666666667,"y":0.0625},{"x":2001.75,"y":0.0665983606557377},{"x":2001.83333333333,"y":0.112704918032787},{"x":2001.91666666667,"y":0.140368852459016}]},{"name":"Amarillo","data":[{"x":2000,"y":0.224385245901639},{"x":2000.08333333333,"y":0.206967213114754},{"x":2000.16666666667,"y":0.171106557377049},{"x":2000.25,"y":0.30327868852459},{"x":2000.33333333333,"y":0.235655737704918},{"x":2000.41666666667,"y":0.266393442622951},{"x":2000.5,"y":0.370901639344262},{"x":2000.58333333333,"y":0.381147540983607},{"x":2000.66666666667,"y":0.337090163934426},{"x":2000.75,"y":0.316598360655738},{"x":2000.83333333333,"y":0.299180327868852},{"x":2000.91666666667,"y":0.309426229508197},{"x":2001,"y":0.316598360655738},{"x":2001.08333333333,"y":0.297131147540984},{"x":2001.16666666667,"y":0.288934426229508},{"x":2001.25,"y":0.359631147540984},{"x":2001.33333333333,"y":0.309426229508197},{"x":2001.41666666667,"y":0.339139344262295},{"x":2001.5,"y":0.399590163934426},{"x":2001.58333333333,"y":0.366803278688525},{"x":2001.66666666667,"y":0.302254098360656},{"x":2001.75,"y":0.310450819672131},{"x":2001.83333333333,"y":0.326844262295082},{"x":2001.91666666667,"y":0.388319672131148}]},{"name":"Arlington","data":[{"x":2000,"y":0.367827868852459},{"x":2000.08333333333,"y":0.370901639344262},{"x":2000.16666666667,"y":0.415983606557377},{"x":2000.25,"y":0.41905737704918},{"x":2000.33333333333,"y":0.460040983606557},{"x":2000.41666666667,"y":0.510245901639344},{"x":2000.5,"y":0.488729508196721},{"x":2000.58333333333,"y":0.464139344262295},{"x":2000.66666666667,"y":0.536885245901639},{"x":2000.75,"y":0.471311475409836},{"x":2000.83333333333,"y":0.508196721311475},{"x":2000.91666666667,"y":0.487704918032787},{"x":2001,"y":0.487704918032787},{"x":2001.08333333333,"y":0.494877049180328},{"x":2001.16666666667,"y":0.528688524590164},{"x":2001.25,"y":0.548155737704918},{"x":2001.33333333333,"y":0.576844262295082},{"x":2001.41666666667,"y":0.516393442622951},{"x":2001.5,"y":0.593237704918033},{"x":2001.58333333333,"y":0.568647540983607},{"x":2001.66666666667,"y":0.552254098360656},{"x":2001.75,"y":0.564549180327869},{"x":2001.83333333333,"y":0.549180327868853},{"x":2001.91666666667,"y":0.597336065573771}]},{"name":"Austin","data":[{"x":2000,"y":0.774590163934426},{"x":2000.08333333333,"y":0.777663934426229},{"x":2000.16666666667,"y":0.805327868852459},{"x":2000.25,"y":0.807377049180328},{"x":2000.33333333333,"y":0.887295081967213},{"x":2000.41666666667,"y":0.929303278688525},{"x":2000.5,"y":0.934426229508197},{"x":2000.58333333333,"y":0.903688524590164},{"x":2000.66666666667,"y":0.92827868852459},{"x":2000.75,"y":0.942622950819672},{"x":2000.83333333333,"y":0.921106557377049},{"x":2000.91666666667,"y":0.940573770491803},{"x":2001,"y":0.859631147540984},{"x":2001.08333333333,"y":0.951844262295082},{"x":2001.16666666667,"y":0.926229508196721},{"x":2001.25,"y":0.952868852459016},{"x":2001.33333333333,"y":0.961065573770492},{"x":2001.41666666667,"y":0.956967213114754},{"x":2001.5,"y":0.997950819672131},{"x":2001.58333333333,"y":0.980532786885246},{"x":2001.66666666667,"y":0.908811475409836},{"x":2001.75,"y":0.836065573770492},{"x":2001.83333333333,"y":0.966188524590164},{"x":2001.91666666667,"y":1}]},{"name":"Bay Area","data":[{"x":2000,"y":0.436475409836066},{"x":2000.08333333333,"y":0.535860655737705},{"x":2000.16666666667,"y":0.566598360655738},{"x":2000.25,"y":0.501024590163934},{"x":2000.33333333333,"y":0.592213114754098},{"x":2000.41666666667,"y":0.662909836065574},{"x":2000.5,"y":0.581967213114754},{"x":2000.58333333333,"y":0.625},{"x":2000.66666666667,"y":0.543032786885246},{"x":2000.75,"y":0.519467213114754},{"x":2000.83333333333,"y":0.595286885245902},{"x":2000.91666666667,"y":0.618852459016393},{"x":2001,"y":0.557377049180328},{"x":2001.08333333333,"y":0.501024590163934},{"x":2001.16666666667,"y":0.683401639344262},{"x":2001.25,"y":0.623975409836066},{"x":2001.33333333333,"y":0.601434426229508},{"x":2001.41666666667,"y":0.700819672131147},{"x":2001.5,"y":0.684426229508197},{"x":2001.58333333333,"y":0.699795081967213},{"x":2001.66666666667,"y":0.587090163934426},{"x":2001.75,"y":0.654713114754098},{"x":2001.83333333333,"y":0.69672131147541},{"x":2001.91666666667,"y":0.679303278688525}]},{"name":"Beaumont","data":[{"x":2000,"y":0.245901639344262},{"x":2000.08333333333,"y":0.239754098360656},{"x":2000.16666666667,"y":0.252049180327869},{"x":2000.25,"y":0.263319672131148},{"x":2000.33333333333,"y":0.371926229508197},{"x":2000.41666666667,"y":0.304303278688525},{"x":2000.5,"y":0.275614754098361},{"x":2000.58333333333,"y":0.212090163934426},{"x":2000.66666666667,"y":0.371926229508197},{"x":2000.75,"y":0.32172131147541},{"x":2000.83333333333,"y":0.278688524590164},{"x":2000.91666666667,"y":0.217213114754098},{"x":2001,"y":0.290983606557377},{"x":2001.08333333333,"y":0.263319672131148},{"x":2001.16666666667,"y":0.320696721311475},{"x":2001.25,"y":0.310450819672131},{"x":2001.33333333333,"y":0.296106557377049},{"x":2001.41666666667,"y":0.326844262295082},{"x":2001.5,"y":0.311475409836066},{"x":2001.58333333333,"y":0.323770491803279},{"x":2001.66666666667,"y":0.344262295081967},{"x":2001.75,"y":0.16905737704918},{"x":2001.83333333333,"y":0.348360655737705},{"x":2001.91666666667,"y":0.301229508196721}]}],"dataLabels":{"enabled":false},"colors":["#008FFB"]},"auto_update":true},"evals":[],"jsHooks":[]}</script>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<div id="tocnav">
<h2 class="hasAnchor">
<a href="#tocnav" class="anchor"></a>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#bar-charts">Bar charts</a></li>
<li><a href="#line-charts">Line charts</a></li>
<li><a href="#scatter-charts">Scatter charts</a></li>
<li><a href="#pie-charts">Pie charts</a></li>
<li><a href="#radial-charts">Radial charts</a></li>
<li><a href="#radar-charts">Radar charts</a></li>
<li><a href="#heatmap">Heatmap</a></li>
</ul>
</div>
</div>
</div>
<footer><div class="copyright">
<p>Developed by <a href="https://twitter.com/_pvictorr"><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"> Victor Perrier</a>, <a href="https://twitter.com/_mfaan"><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg"> Fanny Meyer</a>.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
</div>
</footer>
</div>
</body>
</html>