getHistogram method.