Skip to content

Instantly share code, notes, and snippets.

metagraf

Prisbasbelopp

Data för de olika indexen har hämtats från SCB:s API för Statistikdatabasen. Utifrån dessa har sedan de alternativa prisbasbeloppen beräknats.

Klicka under grafen för att visa de olika prisbasbeloppen och markera linjerna för att visa siffrorna.

@reinholdsson
reinholdsson / README.md
Last active December 19, 2015 16:28
Mac Programming Setup
require(rCharts)
data <- na.omit(MASS::survey)
data$x <- data$Height
data$y <- data$Pulse
a <- rCharts:::Highcharts$new()
a$chart(type = "scatter")
male <- data[data$Sex == "Male", ]
require(rCharts)
df <- read.csv('DGS10.csv', stringsAsFactors = F)
df <- df[df$VALUE != ".", ]
df$VALUE <- as.numeric(df$VALUE)
df$DATE <- paste("#!", as.numeric(as.Date(df$DATE))*86400000, "!#")
a <- rCharts:::Highcharts$new()
a$series(data = toJSONArray2(df, names = F, json = F))
a$chart(zoomType='x')
@reinholdsson
reinholdsson / README.md
Last active October 8, 2017 22:45
Highcharts: Time Series Example
@reinholdsson
reinholdsson / code.R
Created July 2, 2013 16:13
Highcharts: Categorical xAxis
library(rCharts)
data <- data.frame(x = LETTERS, y = 1:26)
a <- rCharts:::Highcharts$new()
a$series(data = toJSONArray2(data, json = F, names = F))
a$chart(type = "column")
a$xAxis(type = "category")
a
library(rCharts)
data <- data.frame(x = LETTERS, y = 1:26)
a <- rCharts:::Highcharts$new()
a$data(x = data$x, y = data$y)
a$chart(type = "column")
a$xAxis(type = "category")
a
<!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>
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)
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)