Global growth: How much slower without China? (rCharts post)

A simple growth chart coded with rCharts

This interactive chart can be produced with just a few lines of code:

## Download global growth rates
csv  <- url("")
glob <- read.csv(csv)

## To run the mPlot command, load rCharts

## Treat years as characters to avoid display of days
glob$year <- as.character(glob$year)

## Make the chart
m2 <- mPlot(x = "year", y = c("gr_w", "gr_noChina"), type = "Line", data = glob)
m2$set(pointSize = 0, lineWidth = 1)

When copying the printed code, adjust labels as needed:

"pointSize":              0,
"lineWidth":              1,
"id": "globalGrowth",
"labels": ["Global growht", "Excluding China"] 

Add morris.js and the required dependencies to your html file:

<link rel="stylesheet" href="//">
<script src="//"></script>
<script src="//"></script>
<script src="//"></script>

Show Comments

Stay in touch with me - I send out occasional updates.