Existing histogram examples are based on calculating histograms from samples, for example, if you have a list of individuals and their income. In this case, you already have data for the histogram - you just want to display it.
The difficulty here is that your histogram has cells of variable width. The first thing you can do is ignore the variable width of each bin and just display a simple diagram of the candy. The x axis is a linear scale of income, and the y axis is a linear scale for counting people:
http://bl.ocks.org/1624656
If you want to convert this to a histogram, you cannot just replace these fixed-width lines with variable-width bars; you need to normalize the data so that the stroke area encodes the frequency of people with that income. Therefore, the width of the bar is a range of income (for example, from 0 to 8.8 for the first bunker), and the height of the bar is the number of people divided by the width. As a result, the area (width Γ height) is proportional to the number of people. It looks like this:
http://bl.ocks.org/1624660
source share