Skip to content

Commit

Permalink
Barchart styling (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-wolf authored Jan 19, 2025
2 parents fb62023 + dd741dc commit 395e707
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions gallery/barchart.typ
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
)

#canvas({
draw.set-style(legend: (fill: white))
draw.set-style(legend: (fill: white), barchart: (bar-width: .8, cluster-gap: 0))
chart.barchart(mode: "clustered",
size: (9, auto),
label-key: 0,
value-key: (..range(1, 5)),
bar-width: .8,
x-tick-step: 2.5,
data2,
labels: ([Low], [Medium], [High], [Very high]),
Expand Down
4 changes: 4 additions & 0 deletions src/chart/barchart.typ
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@
/// they represent.
///
/// = Styling
/// Can be applied with `cetz.draw.set-style(barchart: (bar-width: 1))`.
///
/// *Root*: `barchart`.
/// #show-parameter-block("bar-width", "float", default: .8, [
/// Width of a single bar (basic) or a cluster of bars (clustered) in the plot.])
/// #show-parameter-block("y-inset", "float", default: 1, [
/// Distance of the plot data to the plot's edges on the y-axis of the plot.])
/// #show-parameter-block("cluster-gap", "float", default: 0, [
/// Spacing between bars insides a cluster.])
/// You can use any `plot` or `axes` related style keys, too.
///
/// The `barchart` function is a wrapper of the `plot` API. Arguments passed
Expand Down

0 comments on commit 395e707

Please sign in to comment.