I want draw a histogram for a grayscale picture

Hello everyone, I hope you are all doing well ,
I am currently working on class work and I need to make a histogram for my gray image. I have managed to write the calcHist() function but I failed to draw the histogram.
Can someone explain and provide a link where I can get help to draw and display the histogram .

See OpenCV: Histogram Calculation