Skip to content

Feature request: Add option to not display negative y-axis tick labels #8

@pli9

Description

@pli9

There are some scenarios where the lower and upper y-limits need to be set manually, which may go into the negative values. Here is an example:

dat <- data.frame(
  month = seq(as.Date('2024-01-01'), length.out = 24, by = "month"),
  den = rpois(24, lambda = 5)
)
dat$num <- sapply(dat$den, function(x) rbinom(1, x, 0.25))
controlcharts::spc(
  data = dat,
  numerators = num,
  denominators = den,
  labels = num,
  keys = month,
  spc_settings = list(chart_type = "p"),
  y_axis_settings = list(
    ylimit_l = -20,
    ylimit_u = 100
  ),
  label_settings = list(
    label_position = "bottom",
    label_line_max_length = 30
  )
)

Which generates the following chart:
Image

It would be useful to be able to toggle off any negative tick labels, so these don't show up on the y-axis.

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