This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rCharts) | |
data <- read.csv2("testData.csv") | |
hPlot(V1 ~ namn, data = data, type = "column", group = "parti") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#require(XLConnect) | |
require(data.table) | |
require(rCharts) | |
require(reshape2) | |
require(plyr) | |
# wb1 <- loadWorkbook("nuvarande_ledamoter_RLK.xls") | |
# wb2 <- loadWorkbook("personroster_per_valkrets_R.xls") | |
# ws1 <- as.data.table(readWorksheet(wb1, sheet = 1)) | |
# ws2 <- as.data.table(readWorksheet(wb2, sheet = 1)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype HTML> | |
<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='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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype HTML> | |
<meta charset = 'utf-8'> | |
<html> | |
<head> | |
<script src='http://code.jquery.com/jquery-1.9.1.min.js' type='text/javascript'></script> | |
<script src='http://code.highcharts.com/highcharts.js' type='text/javascript'></script> | |
<script src='http://code.highcharts.com/highcharts-more.js' type='text/javascript'></script> | |
<style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype HTML> | |
<meta charset = 'utf-8'> | |
<html> | |
<head> | |
<link rel='stylesheet' href='http://tenxer.github.io/xcharts/css/master.css'> | |
<script src='http://d3js.org/d3.v2.min.js' type='text/javascript'></script> | |
<script src='http://tenxer.github.io/xcharts/js/xcharts.min.js' type='text/javascript'></script> | |
<style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(reshape2) | |
require(rCharts) | |
df_orig <- read.csv("~/Desktop/df_orig.csv") | |
b <- rCharts:::Highcharts$new() | |
invisible(sapply(c("W", "D", "L"), function(res){ | |
df <- df_orig[df_orig$result == res,] | |
df.lst <- lapply(1:nrow(df), function(i) as.list(df[i,])) | |
b$series(data=df.lst, type = "column", name = res) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a <- rCharts:::Highcharts$new() | |
a$chart(type = "spline") | |
a$series(list( | |
list(data = c(1, 3, 2, 4, 5, 4, 6, 2, 3, 5, NA), dashStyle = "longdash"), | |
list(data = c(NA, 4, 1, 3, 4, 2, 9, 1, 2, 3, 4), dashStyle = "shortdot") | |
)) | |
a$legend(symbolWidth = 80) | |
a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(rCharts) | |
df <- data.frame( | |
name = c("John", "John", "Joe", "Joe", "Jane", "Jane", "Janet", "Janet"), | |
data = sample(1:10, 8, replace = T), | |
stack = c(rep("male", 4), rep("female", 4)) | |
) | |
a <- rCharts:::Highcharts$new() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a <- rCharts:::Highcharts$new() | |
a$yAxis(title=list(text='Series 1', style = list(color = "blue"))) | |
a$yAxis(title=list(text='Series 2', style = list(color = "red")), opposite = T, replace = F) | |
a$series(data = sample(1:100, 12), type = "column", yAxis = 0, color = "blue") | |
a$series(data = sample(1:100, 12), type = "line", yAxis = 1, color = "red") | |
a$tooltip(shared=T) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a <- rCharts:::Highcharts$new() | |
a$yAxis(title=list(text='Series 1', style = list(color = "blue"))) | |
a$yAxis(title=list(text='Series 2', style = list(color = "red")), opposite = T, replace = F) | |
a$series(data = sample(1:100, 12), type = "column", yAxis = 0, color = "blue") | |
a$series(data = sample(1:100, 12), type = "line", yAxis = 1, color = "red") | |
a$tooltip(shared=T) |