# 2. highcharter 동적 차트 (웹/대시보드용)
if (!require("highcharter")) install.packages("highcharter")
library(highcharter)
# 애플 주가와 거래량을 하나의 인터랙티브 차트로 표현
apple_only <- tech_stocks %>% filter(symbol == "AAPL")
highchart(type = "stock") %>%
hc_add_series(apple_only, type = "line", hcaes(x = date, y = adjusted), name = "AAPL Price") %>%
hc_add_series(apple_only, type = "column", hcaes(x = date, y = volume), name = "Volume", yAxis = 1) %>%
hc_yAxis_multiples(
list(title = list(text = "Stock Price")),
list(title = list(text = "Trading Volume"), opposite = TRUE)
) %>%
hc_title(text = "AAPL Stock Price and Volume")