Skip to content
Snippets Groups Projects

Déploiement juin 2024

Closed Juliette Engelaere-Lefebvre requested to merge dev into main
1 file
+ 6
10
Compare changes
  • Side-by-side
  • Inline
@@ -21,8 +21,7 @@ creer_hc_graph_evol_compar <- function(.rv = r, selection_date = input$selection
@@ -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),
mutate(col = if_else(CodeZone == .rv$selection_terr_zone, 1, 2),
indice = 100 * valeur / nth(valeur, 1)) %>%
indice = 100 * valeur / nth(valeur, 1)) %>%
ungroup() %>%
ungroup() %>%
arrange(annee, CodeZone) %>%
arrange(annee, CodeZone)
mutate(date2 = format_fr_date(date))
nom_ter_1 <- filter(data_0, CodeZone == .rv$selection_terr_zone) %>% pull(Zone) %>% unique
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
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
@@ -32,21 +31,18 @@ creer_hc_graph_evol_compar <- function(.rv = r, selection_date = input$selection
highchart() %>%
highchart() %>%
hc_title(text = titre_graph_compar, align = "left") %>%
hc_title(text = titre_graph_compar, align = "left") %>%
hc_yAxis(title = list(text = "Indice")) %>%
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(
hc_add_series(
data = data_compare,
data = data_compare %>% mutate(date = format_fr_date(date)),
hcaes(x = date, y = indice, group = Zone, color = col),
hcaes(x = date, y = indice, group = Zone, color = col),
type = "line",
type = "line",
lineWidth = 2,
lineWidth = 2,
marker = list(enabled = TRUE, radius = 2, fillColor = list(color_base, color_compar))
marker = list(enabled = TRUE, radius = 2, fillColor = list(color_base, color_compar))
) %>%
) %>%
hc_colors(colors = c(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_legend(enabled = TRUE, shared = TRUE) %>%
hc_exporting(enabled = TRUE) %>%
hc_exporting(enabled = TRUE) %>%
hc_tooltip(pointFormat = "<b>{point.Zone}</b><br/>{point.indice:,.0f}",
hc_tooltip(pointFormat = "<b>{point.Zone}</b><br/>{point.indice:,.0f}",
Loading