Skip to content
Snippets Groups Projects

Déploiement juin 2024

Closed Juliette Engelaere-Lefebvre requested to merge dev into main
@@ -21,8 +21,7 @@ creer_hc_graph_evol_compar <- function(.rv = r, selection_date = input$selection
mutate(col = if_else(CodeZone == .rv$selection_terr_zone, 1, 2),
indice = 100 * valeur / nth(valeur, 1)) %>%
ungroup() %>%
arrange(annee, CodeZone) %>%
mutate(date2 = format_fr_date(date))
arrange(annee, CodeZone)
nom_ter_1 <- filter(data_0, CodeZone == .rv$selection_terr_zone) %>% pull(Zone) %>% unique
nom_ter_2 <- filter(data_0, CodeZone == .rv$code_ter_compar) %>% pull(Zone) %>% unique
@@ -32,21 +31,18 @@ creer_hc_graph_evol_compar <- function(.rv = r, selection_date = input$selection
highchart() %>%
hc_title(text = titre_graph_compar, align = "left") %>%
hc_yAxis(title = list(text = "Indice")) %>%
hc_xAxis(type = 'datetime', dateTimeLabelFormats = list(day = '%d/%m/%Y')) %>%
hc_xAxis(
type = 'datetime',
categories = as.list(unique(format_fr_date(data_compare$date)))
) %>%
hc_add_series(
data = data_compare,
data = data_compare %>% mutate(date = format_fr_date(date)),
hcaes(x = date, y = indice, group = Zone, color = col),
type = "line",
lineWidth = 2,
marker = list(enabled = TRUE, radius = 2, fillColor = list(color_base, color_compar))
) %>%
hc_colors(colors = c(color_base, color_compar)) %>%
hc_add_series(
data = data_compare %>% filter(annee == selection_date),
hcaes(x = date, y = indice, group = date2, color = color_select),
type = "scatter",
marker = list(enabled = TRUE, symbol = "circle", radius = 4, fillColor = color_select)
) %>%
hc_legend(enabled = TRUE, shared = TRUE) %>%
hc_exporting(enabled = TRUE) %>%
hc_tooltip(pointFormat = "<b>{point.Zone}</b><br/>{point.indice:,.0f}",
Loading