Skip to content

Display absolute values instead of percentages #23

@jassler

Description

@jassler

Inspired by this StackOverflow question, it would be nice to have a little more flexibility when displaying the values below labels. Currently, showRatioDonut and showRatioPie can only be set to TRUE or FALSE to show or hide the values.

Proposed solution

The parameters showRatioDonut and showRatioPie could instead be assigned a character string value or a function.

  • "percentage" to display the ratio percentages (default behavior of TRUE),
  • "absolute" to display the absolute values,
  • "none" to hide values (default behavior of FALSE),
  • a function to have more flexibility in how to transform the values. I.e., say we pass showRatioDonut = function(a) scales::scientific(a), then the absolute values are first converted into scientific notation before being displayed below the labels.

To stay backward compatible, we'd only have to verify if showRatioDonut or showRatioPie is a logical value - if so, then it needs to be reassigned the appropriate string value ("percentage" for TRUE, "none" for FALSE).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions