Here is the reprex. I hope I did this correctly. I created a data_frame with sample data from my original data file. I am trying to create a stacked line graph by month with the x-axis as Start, y-axis as Capacity, and fill by Project. Is there a way to graph the Capacity data through time (ie, monthly) without creating a new dataframe with monthly time series data for each x and y variable?
library(tidyverse)
library(tibble)
library(ggthemes)
library(lubridate)
eia_lng <- data_frame(
Project=c("SP1", "SP2", "SP3", "CP1", "CP2"),
Start=c(ymd(20170501,20180601, 20190201,20190901,20200101)),
Capacity=c(0.8,1.2,0.6,0.4,0.8))
ggplot(eia_lng)+
geom_area(aes(x=Start, y= Capacity, fill=Project)) +
labs(y="Bcf/d", x="", title="LNG Growth",
caption="Source: EIA") +
theme_bw()+
scale_y_continuous(labels=comma) +
theme(axis.title.x = element_text(size=8,face="bold"),
axis.title.y = element_text(size=8,face="bold"),
legend.text = element_text(size=8, face="bold"),
legend.title = element_blank(),
plot.title = element_text(size=10, face="bold"),
plot.caption = element_text(size=7, face="bold"),
panel.background = element_rect(colour = "grey", size = 0.5),
plot.background = element_rect(colour = "black", size = 0.75 ))