This might be an incredibly simple concept, but I don't have a background in stats (if this is even statistics related) beyond one Statistics class in college many moons ago, so I apologize in advance if this is well documented, I'm just not familiar with this area whatsoever.
Essentially, I have a sorted set of positive integers. I want to create a bar chart that represents the distribution of values, with the peak being the mean and I want the $x$-axis to be the sorted list of integers, with the height of each bar inversely representing the distance from the mean.
An example might look something like this:

Note that the height difference between $e$ and $f$ is greater than the difference between $c$ and $b,$ because $f-e > b-c$.
So essentially the higher the $Y$ value, the closer it is to the mean. Although in my example it might've been better to graph $g$ as zero, since it has the highest distance from the mean.
So if the $x$ axis would look like: $$[1,2,3,5,5,7,11]$$ Then the $y$ axis might look something like:
$$[0.2, 0.5, 0.75, 0.95, 0.95, 0.45, 0.0]$$
Is there some kind of simple formula or equation I'm missing to calculate a $y$ value that represents this?
I ate some food, sat down and thought about it for a bit and ended up with this solution:
Essentially calculate mean. Then calculate which is higher, mean - min or mean + max, and call that greatest distance. Now for each value, I subtract the greatest distance from the value, or I subtract the value from the greatest distance. This results in the value that has the greatest distance being 1, and the mean ends up being 0. I then just subtract that value from 1 and that's the value at each point.
Not sure how to write it mathematically, but codewise I ended up with this quick javascript snippet: