Skip to content

Commit

Permalink
🚧 Added labels to the graph
Browse files Browse the repository at this point in the history
  • Loading branch information
BattleCh1cken committed Jan 12, 2024
1 parent f420bad commit b341498
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions themes/radial/components/graphs.typ
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,31 @@
///
/// - ..data (dictionary):
/// -> content
#let plot(..data) = {
#let plot(
title: "",
x_label: "",
y_label: "",
..data
) = {
set align(center)
cetz.canvas(
length: 1cm, {
length: 8.5%, {
import cetz.draw: *
import cetz.plot
import cetz.palette

plot.plot(
size: (10, 6), axis-style: "left", x-grid: "both", y-grid: "both", {
name: "plot",
style: palette.tango,
size: (9, 6), axis-style: "left", x-grid: "both", y-grid: "both", {
for row in data.pos() {
plot.add(row.data)
plot.add(row.data, fill: true)
}
})

content("plot.top", [*#title*])
content((to: "plot.bottom", rel: (0,-0.5)), [#x_label])
content((to: "plot.left", rel: (-0.5, 0)), [#y_label], angle: 270deg)
},
)
}

0 comments on commit b341498

Please sign in to comment.