Not sure why this has to be complicated. A simple addition of all values divided by the number of bars, possibly some rounding, like it has been done for cewnturies.
Thanks for being less than remotely helpful though.
The average will be calculated from the values of the bars, whether using one of their properties in the composition, or by averaging out the data that drives them. And I'm guessing that you know how to calculate an average, so what you're really asking is how to drive the value of the bars from JSON. Have you read the Adobe docs on how to use JSON to drive expressions? Might be the first place to start, and then come back if you've got specific questions.