library(SveltePlots)
sp(
data = economics,
mapping = spaes(x = date, y = unemploy),
type = "line",
tooltip = TRUE,
colors = "red"
) |>
sp_add_series(
data = economics,
mapping = spaes(x = date, y = pce),
type = "line",
tooltip = TRUE,
colors = "green"
) |>
sp_add_series(
data = economics,
mapping = spaes(x = date, y = psavert),
type = "line",
tooltip = FALSE,
colors = "blue"
) |>
sp_x_axis(
format = "%b %Y",
ticks = 4,
label = "Date",
font_size_label = 14,
font_size_ticks = 12,
rotation_axis_ticks = -30
) |>
sp_y_axis(
font_size_label = 14,
font_size_ticks = 12
)
Run the code above in your browser using DataLab