Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Labels on a stacked area chart #684

Closed
palewire opened this issue Mar 30, 2018 · 3 comments
Closed

Labels on a stacked area chart #684

palewire opened this issue Mar 30, 2018 · 3 comments
Labels
question vega: vega-lite Requires upstream action in `vega-lite`

Comments

@palewire
Copy link
Contributor

The stacked area chart example is great.

screenshot from 2018-03-30 15-36-15

But it would be even better if you could put labels on the areas, as the New York Times did here:

screenshot from 2018-03-30 15-37-14

Possible?

@jakevdp jakevdp added question vega: vega-lite Requires upstream action in `vega-lite` labels Mar 30, 2018
@jakevdp
Copy link
Collaborator

jakevdp commented Mar 30, 2018

I don't think vega-lite makes that kind of labeling possible. You could externally compute the location of the text labels and use mark_text, but that's not a very good solution.

@kanitw
Copy link
Member

kanitw commented Mar 30, 2018

I don't think vega-lite makes that kind of labeling possible

Yeah, currently Vega-Lite doesn't support this.

But once we add add explicit stack transform, we should be able to reproduce (or at least getting close to) this vega example.

If you want to use this, you're welcome to submit a PR to Vega-Lite :)

@jakevdp
Copy link
Collaborator

jakevdp commented May 27, 2019

The stack transform is part of Altair 3, so stacked labels like this should be possible now. A relevant example from the gallery is this: https://altair-viz.github.io/gallery/stacked_bar_chart_with_text.html

@jakevdp jakevdp closed this as completed May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question vega: vega-lite Requires upstream action in `vega-lite`
Projects
None yet
Development

No branches or pull requests

3 participants