diff --git a/dashboard.Rmd b/dashboard.Rmd index a46f8a0..278af80 100644 --- a/dashboard.Rmd +++ b/dashboard.Rmd @@ -388,8 +388,12 @@ output$cost_index_chart <- renderDygraph({ if (selected_scale == "Index") { value_columns <- paste0(selected_methods, " Index") + + y_label <- "Cost Index" } else if (selected_scale == "Loss") { value_columns <- paste0(selected_methods, " Loss") + + y_label <- "Normalized Loss" } normalization_index <- normalized_data %>% @@ -414,7 +418,7 @@ output$cost_index_chart <- renderDygraph({ select(-normalization_year) %>% xts(order.by = normalization_index$normalization_year) - dygraph(normalization_index_ts) %>% + dygraph(normalization_index_ts, ylab = y_label) %>% dyOptions( colors = paletteer_d("ggthemes::Classic_Purple_Gray_12", ncol(normalization_index - 1)), fillGraph = T,