Line plots a very common type of plots specially in finance domain. These plots are useful for viewing the variation in a numerical attribute over a time period.
Highcharter is a R wrapper for Highcharts javascript library and its modules. Highcharts is very flexible and customizable javascript charting library and it has a great and powerful API.
Line plots a very common type of plots specially in finance domain. These plots are useful for viewing the variation in a numerical attribute over a time period.
We are going to use this dataset for plotting different variations of the scatterplots
library(tidyverse)
library(highcharter)
library(DT)
data(economics_long, package = "ggplot2")
economics_long2 <- dplyr::filter(economics_long, variable %in% c("pop", "uempmed", "unemploy"))
DT::datatable(economics_long2)
hchart(
dplyr::filter(economics_long, variable %in% c("unemploy")),
"line",
hcaes(x=date,
y=value01)
)
hchart(
dplyr::filter(economics_long, variable %in% c("unemploy")),
"line",
hcaes(x=date,
y=value01),
color = "#fca311"
)
hchart(
dplyr::filter(economics_long, variable %in% c("pop","unemploy")),
"line",
hcaes(x=date,
y=value01,
group = variable),
color = c("#00296b","#fca311")
)
hchart(
dplyr::filter(economics_long, variable %in% c("pop","unemploy", "uempmed")),
"line",
hcaes(x=date,
y=value01,
group = variable),
color = c("#00296b","#fca311","#177e89")
)
hchart(
dplyr::filter(economics_long, variable %in% c("pop","unemploy", "uempmed")),
"line",
hcaes(x=date,
y=value01,
group = variable),
color = c("#00296b","#fca311","#177e89")
) %>%
hc_legend(
layout = "horizontal",
align = "right",
verticalAlign = "bottom"
)
hchart(
dplyr::filter(economics_long, variable %in% c("pop","unemploy", "uempmed")),
"line",
hcaes(x=date,
y=value01,
group = variable),
color = c("#00296b","#fca311","#177e89")
) %>%
hc_legend(
layout = "horizontal",
align = "left",
verticalAlign = "bottom"
)
hchart(
dplyr::filter(economics_long, variable %in% c("pop","unemploy", "uempmed")),
"line",
hcaes(x=date,
y=value01,
group = variable),
color = c("#00296b","#00509d","#fdc500")
) %>%
hc_legend(
layout = "horizontal",
align = "right",
verticalAlign = "top"
)
hchart(
dplyr::filter(economics_long, variable %in% c("pop","unemploy", "uempmed")),
"line",
hcaes(x=date,
y=value01,
group = variable),
color = c("#00296b","#00509d","#fdc500")
) %>%
hc_legend(
layout = "horizontal",
align = "left",
verticalAlign = "top"
)
hchart(
dplyr::filter(economics_long, variable %in% c("pop","unemploy", "uempmed")),
"line",
hcaes(x=date,
y=value01,
group = variable),
color = c("#00296b","#00509d","#fdc500")
) %>%
hc_legend(
layout = "vertical",
align = "right",
verticalAlign = "top"
)
hchart(
economics_long,
"line",
hcaes(x=date,
y=value01,
group = variable),
color = c("#00296b","#fca311","#177e89", "#8f2d56", "#6d597a")
)