Skip to content

Commit

Permalink
improve aliasing on stacked area chart
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesrswift committed Aug 9, 2024
1 parent 91c3419 commit 0011f5d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/charts/area/plotter.typ
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
add.fill-between(
data.enumerate().map(((k,v))=>(x-list.at(k), v + y-offsets.at(k))),
data.enumerate().map(((k,v))=>(x-list.at(k), y-offsets.at(k))),
style: (stroke: none),
)

add.xy(
data.enumerate().map(((k,v))=>(x-list.at(k), v + y-offsets.at(k))),
)

if stack == true {
Expand Down
5 changes: 3 additions & 2 deletions src/charts/area/stacked.typ
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
for (series-index, data) in data.enumerate(){
series-data.push(
(
label: if label-key != none {data.at(label-key)},
// label: if label-key != none {data.at(label-key)},
label: none,
data: y-keys.map(k=>data.at(k, default: 0))
)
)
Expand All @@ -23,7 +24,7 @@
plotter(
series-data,
number-points: y-keys.len(),
x-list: x-list,
x-key: x-key,
area-style: area-style,
axes: axes,
stack: true,
Expand Down
Binary file added tests/charts/area/stacked/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/charts/area/stacked100/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0011f5d

Please sign in to comment.