cetz-package / cetz

CeTZ: ein Typst Zeichenpaket - A library for drawing stuff with Typst.
https://cetz-package.github.io
GNU Lesser General Public License v3.0
897 stars 36 forks source link

Error bars? #573

Closed dantechguy closed 6 months ago

dantechguy commented 6 months ago

I've looked but I can't find any reference for how to add error bars to column charts?

To be concrete, I mean like this: image

If there is a quick and easy fix I can apply that would be great (dissertation due quite soon!). Thanks for your help!

johannes-wolf commented 6 months ago

Is using a local clone of cetz an option? If so, I can create a PR that adds that feature and you can use that branch.

dantechguy commented 6 months ago

@johannes-wolf I'm using the Typst CLI so I presume so! That would be tremendously useful, thank you so so much!

Purely curious: is there a reason you couldn't merge the PR into the live package? I imagine many people would find it useful! :)

johannes-wolf commented 6 months ago

This would be a new version of cetz and "0.3.0" is not ready yet. Also, PR's need to get through review before merging them, which can take quite some time.

johannes-wolf commented 6 months ago

Do you need this feature in combination with clustered charts?

dantechguy commented 6 months ago

Edit: just seen your PR which made my previous comment redundant.

In short, yes I do need it in combination with clustered charts :) Thank you!

johannes-wolf commented 6 months ago

Ok. The PR is ready to be tested. I've added a error-key: argument to both chart elements + the plot.add-bar function. You have to pass the key (int or string) to access the error data of your data-rows (like with label-key and value-key).

dantechguy commented 6 months ago

@johannes-wolf Just tried it and it's awesome! Thank you so much <3 Dissertation saved😆