library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.4.3
# -----------------------------
# GPU Market Data
# -----------------------------
gpu_data <- data.frame(
  Year = c("2022", "2023", "2024", "2025", "2026", "2027 (Proj.)"),
  Market_Value = c(41.2, 65.5, 101.4, 128.2, 144.8, 170.5)
)

# -----------------------------
# Create colorful bar chart
# -----------------------------
ggplot(gpu_data, aes(x = Year, y = Market_Value, fill = Year)) +
  
  geom_col(width = 0.7) +
  
  # Market value labels
  geom_text(
    aes(label = paste0("$", Market_Value, "B")),
    vjust = -0.5,
    size = 4.5,
    fontface = "bold"
  ) +
  
  # Different color for each year
  scale_fill_manual(values = c(
    "2022" = "#3498DB",
    "2023" = "#9B59B6",
    "2024" = "#E74C3C",
    "2025" = "#F39C12",
    "2026" = "#2ECC71",
    "2027 (Proj.)" = "#1ABC9C"
  )) +
  
  # Titles and author information
  labs(
    title = "Global GPU Market Value (2022–2027)",
    subtitle = "Market value in USD billions",
    x = "Year",
    y = "Market Value (USD Billions)",
    
    caption = paste(
      "Created by: Satya Panda",
      "\nSource: Silicon Analysts (2026)"
    )
  ) +
  
  # Chart styling
  theme_minimal(base_size = 14) +
  theme(
    plot.title = element_text(
      face = "bold",
      size = 20
    ),
    
    plot.subtitle = element_text(
      size = 13,
      color = "gray40"
    ),
    
    plot.caption = element_text(
      hjust = 0,
      size = 9,
      color = "gray30",
      lineheight = 1.2
    ),
    
    axis.title = element_text(
      face = "bold"
    ),
    
    axis.text = element_text(
      size = 11
    ),
    
    legend.position = "none",
    
    panel.grid.minor = element_blank()
  ) +
  
  # Space for labels above bars
  ylim(0, 190)