diff --git a/src/chart/pyramid.typ b/src/chart/pyramid.typ index 53563aa..1e9b27c 100644 --- a/src/chart/pyramid.typ +++ b/src/chart/pyramid.typ @@ -1,6 +1,6 @@ #import "/src/cetz.typ": draw, styles, palette, coordinate -// Piechart Label Kind +// Pyramid Chart Label Kind #let label-kind = (value: "VALUE", percentage: "%", label: "LABEL") // Pyramid Chart Default Style @@ -464,4 +464,4 @@ } }) }) -} \ No newline at end of file +} diff --git a/tests/chart/pyramid/ref/1.png b/tests/chart/pyramid/ref/1.png new file mode 100644 index 0000000..fd199a8 Binary files /dev/null and b/tests/chart/pyramid/ref/1.png differ diff --git a/tests/chart/pyramid/test.typ b/tests/chart/pyramid/test.typ new file mode 100644 index 0000000..3a55852 --- /dev/null +++ b/tests/chart/pyramid/test.typ @@ -0,0 +1,25 @@ +#set page(width: auto, height: auto) +#import "/src/cetz.typ": * +#import "/src/lib.typ": * +#import "/tests/helper.typ": * + +#let data = ( + ([Category A], 10), + ([Category B], 20), + ([Category C], 30), +) + +#test-case(args => { + chart.pyramid( + data, + value-key: 1, + label-key: 0, + side-label: (content: (value, label) => [#value%]), + mode: args.mode + ) +}, args: ( + (mode: "REGULAR"), + (mode: "AREA-HEIGHT"), + (mode: "HEIGHT"), + (mode: "WIDTH"), +))