| a11y_ggplot2_bar | R Documentation |
A minimal wrapper for a simple bar chart with accessibility features using ggplot2::ggplot2. Provides a high-contrast color palette, black bar outlines, and a minimal theme by default.
a11y_ggplot2_bar(
data,
x,
y,
accessible_colors = NULL,
border_color = "#000000",
bar_width = 0.9,
legend_title = NULL,
...
)
data |
Data frame |
x |
Column name for categories (unquoted) |
y |
Column name for bar heights (unquoted) |
accessible_colors |
(optional) Character vector of colors for the palette |
border_color |
(optional) Color for bar outlines (default: |
bar_width |
(optional) Bar width (default: |
legend_title |
(optional) Title for the legend (default: |
... |
Additional arguments passed to |
A ggplot2::ggplot() object
df <- data.frame(
category = c("Alpha", "Beta", "Gamma"),
count = c(23, 17, 31)
)
a11y_ggplot2_bar(
data = df, x = category, y = count,
title = "Counts by Category"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.