I have a table with weekly data that I am comparing against a yearly target. I used to add the yearly target like this:
bb_y_grid(show = TRUE,
lines = list(list(value = 99, text = "Goal")))
This was a nice and simple solution, however the goals have shifted in 2022 so now I want to show 99 for x = 2021 and 98 for x = 2022. I could not find an option to limit the gridline to only show for a range of x.
My next idea was to add a line to my data. So I have 1 line for the real data and 1 line for the budget. This looks as follows:
However, I don't want to show the points for the budget line, only for the real data. My code is as follows:
billboarder() %>%
bb_linechart(dt.Cycle(), mapping = bbaes(YearWeekCiclo, Perc, Type),
show_point = T, type = "line") %>%
bb_x_axis(type = "category", tick = list(rotate = 90, width = 100), height = 90,
label = list(text = "Year-Week-Cycle", position = "outer-right")) %>%
bb_y_axis(label = list(text = "Percentage", position = "outer-top"), max = 100) %>%
bb_y_grid(show = TRUE) %>%
bb_legend(show = FALSE)
My question: How can I add a second line to my graph with it's own styling
Note: If you are only familiar with using billboard.js in JavaScript but know a solution I can try to translate that back to R language myself if needed