Skip to content
Snippets Groups Projects
Commit 0a6b3d30 authored by Juliette Engelaere-Lefebvre's avatar Juliette Engelaere-Lefebvre
Browse files

Merge branch '76-graphiques-dates-en-anglais-pour-les-courbes' into 'dev'

Resolve "Graphiques - Dates en anglais pour les courbes"

Closes #76

See merge request !61
parents b07e58f7 37b8b429
No related branches found
No related tags found
1 merge request!61Resolve "Graphiques - Dates en anglais pour les courbes"
...@@ -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}",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment