Web stats for each individual web page

I want to be able to display web stats for each individual web page. Currently, I have created a widget which shows the overall web statistics on our website. I want to display the web stats of each individual page.

How many times this page was visited? (overall graph)

How many times over the past year by month this page was visited?

The user can click on the stats section to see this information. I saw in the log that it track each page that has been visited.

Is there a way to automate this process?

If you have a common footer that you include on all your pages, then stick the tracking code there.

You could probably write a script that (a) finds all the files that contain a tag, and (b) does an in-situ edit to insert the tracking code.