Skip to content

Commit 0b9ad4d

Browse files
committedDec 30, 2024·
fix: fix wrong labels for faceted pie chart
1 parent 9fad1bb commit 0b9ad4d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed
 

‎R/piechart.R

+2-3
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ PieChartAtomic <- function(
7676
} else {
7777
pos_df <- do.call(rbind, lapply(split(data, data[[concated_facet_by]]), .pos_df_one_facet))
7878
}
79-
if (!is.null(label)) {
80-
pos_df[[label]] <- data[[label]]
81-
}
8279
if (isTRUE(clockwise)) {
8380
colors <- palette_this(rev(levels(data[[x]])), palette = palette, palcolor = palcolor)
8481
} else {
@@ -157,6 +154,8 @@ PieChartAtomic <- function(
157154
#'
158155
#' # y from count
159156
#' PieChart(data, x = "group")
157+
#' # add label
158+
#' PieChart(data, x = "group", label = ".y")
160159
PieChart <- function(
161160
data, x, y = NULL, label = y, split_by = NULL, split_by_sep = "_", clockwise = TRUE,
162161
facet_by = NULL, facet_scales = "free_y", facet_ncol = NULL, facet_nrow = NULL, facet_byrow = TRUE,

‎man/PieChart.Rd

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.