In a bar-graph, the height of the bars represent the frequency of a particular category but it is counter-intuitive that in a histogram, instead of the height of the bar(which represents the frequency density), the area of the bar represents the frequency of the particular class. Why is this so?
note that the purpose of a histogram is to estimate a probability density function for a continuous variable . for a probability density function (PDF) the area under the function is the probability of an event not the value of the function itself. so here we also want the area to represent the probability (relative frequency) of the events (our bins). if this is not done we would not get the visual similarity between the PDF and the histogram and other visual properties of the main distribution would not show themselves in the histogram (like skewness of data) correctly since we have not followed the definition.
so in a histogram, the height of each bin is:
in which case the area of the bar shows the absolute frequency .or
in which case the area shows the probability of the bin (relative frequency).
since the two cases only differ in a scaling factor (1/total_number_of_data) the general visual properties of the two cases are the same.
also, note that since the parameter "width_of_the_bin" is usually considered equal among the bins this can again make the shape of the histogram the same as, if you used frequency for the heights of the bars. (since they are only different in a scaling factor). and in many examples out there this is what's happening.
although I'm not sure if this is correct according to the above definition(which there does not seem to be a consensus on), since the visual properties of the two plots are the same it does not cause any troubles when only the shape of the histogram is considered.
you can see examples for cases above in the Wikipedia page for histogram.