Skip to content

Layer order for line labels #9

@pli9

Description

@pli9

With the current layer order for the line labels, they can potentially be hidden behind the dots and lines on the charts. Here is an example below:

dat <- data.frame(
  month = seq(as.Date('2024-01-01'), length.out = 24, by = "month"),
  den = rpois(24, lambda = 150)
)
dat$num <- sapply(dat$den, function(x) rbinom(1, x, 0.25))
controlcharts::spc(
  data = dat,
  numerators = num,
  denominators = den,
  keys = month,
  spc_settings = list(chart_type = "p"),
  line_settings = list(
    show_alt_target = TRUE,
    alt_target = 25,
    colour_alt_target = "#7B1500",
    plot_label_position_alt_target = "below",
    plot_label_show_alt_target = TRUE,
    plot_label_colour_alt_target = "#7B1500",
    plot_label_prefix_alt_target = "National Average: "
  )
)

Which has the following output:

Image

It would be useful to have the labels generated last, so that they are placed on top of the lines and dots.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions