I would suggest that you take a look at D3.js.
If you look at the examples there is a Calendar View that does something closely to what you want to accomplish.
Another example of a similar calendar visualization is Cal-heatmap.
You will find more libraries with similar concepts if you google for "calendar heatmap".