add y axis label to normalization chart

This commit is contained in:
2025-07-19 22:33:41 -04:00
parent fcf00029e1
commit bdd2660bbf
+5 -1
View File
@@ -388,8 +388,12 @@ output$cost_index_chart <- renderDygraph({
if (selected_scale == "Index") { if (selected_scale == "Index") {
value_columns <- paste0(selected_methods, " Index") value_columns <- paste0(selected_methods, " Index")
y_label <- "Cost Index"
} else if (selected_scale == "Loss") { } else if (selected_scale == "Loss") {
value_columns <- paste0(selected_methods, " Loss") value_columns <- paste0(selected_methods, " Loss")
y_label <- "Normalized Loss"
} }
normalization_index <- normalized_data %>% normalization_index <- normalized_data %>%
@@ -414,7 +418,7 @@ output$cost_index_chart <- renderDygraph({
select(-normalization_year) %>% select(-normalization_year) %>%
xts(order.by = normalization_index$normalization_year) xts(order.by = normalization_index$normalization_year)
dygraph(normalization_index_ts) %>% dygraph(normalization_index_ts, ylab = y_label) %>%
dyOptions( dyOptions(
colors = paletteer_d("ggthemes::Classic_Purple_Gray_12", ncol(normalization_index - 1)), colors = paletteer_d("ggthemes::Classic_Purple_Gray_12", ncol(normalization_index - 1)),
fillGraph = T, fillGraph = T,