cetz-package/cetz

Error bars?

Closed this issue · 7 comments

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!

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.

@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! :)

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.

Do you need this feature in combination with clustered charts?

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!

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).

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