library(ggplot2)
library(gridExtra)
data1 = data.frame(Type = c("Other", "Other", "Other", "Other", "Main", "Main", "Main", "Main"),
Breakdown = c("Parks", "Media", "Entertainment", "Franchise", "Parks", "Media", "Entertainment", "Franchise"),
Amount = c(70, 50, 76, 95, 30, 50, 24, 5))
data1$Type <- factor(data1$Type, levels = c("Other", "Main"))
g1 <- ggplot(data1, aes(x = Breakdown, y = Amount, group = Type, fill = Type)) + geom_area(positon="fill") + scale_fill_viridis_d() + theme_minimal() + ggtitle("Положение сегмента компании на рынке") +
theme(legend.position = "none") + xlab("Сегмент") + ylab("Доля сегмента на рынке")
## Warning in geom_area(positon = "fill"): Ignoring unknown parameters: `positon`
data2 = data.frame(Type = c("Other", "Other", "Other", "Other", "Main", "Main", "Main", "Main"),
Year = c("2018", "2019", "2020", "2021", "2018", "2019", "2020", "2021"),
Amount = c(70, 69, 75, 86, 30, 31, 25, 14))
data2$Type <- factor(data2$Type, levels = c("Other", "Main"))
g2 <- ggplot(data2, aes(x = Year, y = Amount, group = Type, fill = Type)) + geom_area(positon="fill") + scale_fill_manual(values = c("#015366", "#A7D1D2")) + theme_minimal() + ggtitle("Положение компании на рынке") +
theme(legend.position = "none") + xlab("Год") + ylab("Доля компании на рынке")
## Warning in geom_area(positon = "fill"): Ignoring unknown parameters: `positon`
g1

g2
