Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! Check out the docs.

Aggregate value as text on bar chart

I’m using the transform property on a barchart to get sum/avg/count/… of a group. I’d like to display the calculated value on top of the barchart, but I can’t figure out how to access the value.


      _d.forEach(trace => {
            y: trace.values,
            x: => this.transformDate(date)),
            type: 'bar',
            text: "i want to be the aggregate value",
            transforms: [{
              type: 'aggregate',
              groups: => this.transformDate(date)),
              aggregations: [
                {target: 'y', func: aggregation, enabled: true}

Here’s one hacky way to access to aggregated data:

Use at your own risk though. We should think about providing a more “official” to access post-transform values. Thanks for writing in.

Thanks for the answer!

I think i’m just going to calculate the values myself then (as I’m already doing it that way to get some % based charts)