Make a Bar Chart with Text Count Labels in Plot

Checkout this example notebook

When counting up a categorical variable as a bar chart, I’d like to show the values as a text label above each bar. I can make a separate dataset using Arquero, but is it possible to access the result of a group transform from within a text mark?

Always learning,
Zach

2 Likes

One approach is

      text: d => d.length, 

I figured this out by first trying d => console.log(d)

Try moving the text channel declaration to the output of the group transform rather than the input. Here is a suggestion:

https://observablehq.com/compare/3b25b91638e413ef...b71fbc332a15a928