Skip to content

Commit

Permalink
handle labels properly (and coerce to content)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesrswift committed Aug 9, 2024
1 parent 2f22a4e commit 618d492
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/charts/area/stacked.typ
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#let stacked(
data,
label-key: none,
x-key: 0,
y-keys: (1,),
area-style: palette.red,
Expand All @@ -14,8 +15,7 @@
for (series-index, data) in data.enumerate(){
series-data.push(
(
// label: if label-key != none {data.at(label-key)},
label: none,
label: if label-key != none {data.at(label-key)},
data: y-keys.map(k=>data.at(k, default: 0))
)
)
Expand All @@ -34,9 +34,9 @@

#let stacked100(
data,
label-key: 0,
x-key: 1,
y-keys: (2,),
label-key: none,
x-key: 0,
y-keys: (1,),
area-style: palette.red,
axes: ("x", "y"),
..plot-args
Expand Down
2 changes: 1 addition & 1 deletion src/plot/legend.typ
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@

// Draw label
content(label-west,
align(left + horizon, label),
align(left + horizon, [#label]),
name: "label", anchor: "west")
}, name: "item", anchor: if style.orientation == ltr { "west" } else { "north-west" })

Expand Down

0 comments on commit 618d492

Please sign in to comment.