Colouring the calendar

Sometimes, just view­ing a time series as a sim­ple graph isn’t enough.

The graph be­low shows the daily vis­it­ors to a lead­ing Indian web­site in 2011. The over­all trends are ap­par­ent. There was a dip in Mar-Apr, and again in Oct, fol­lowed by a steady rise in November.


But what’s also ap­par­ent is a weekly cyc­lic­al­ity: the steady pat­tern of rises and falls sev­er­al times a month, that dis­turbs this trend.

Yet, there’s con­sid­er­able in­sight with­in that cyc­lic­al­ity, that a cal­en­dar heat­map can bring out. Here is the same data on a cal­en­dar heat­map. This is simply a cal­en­dar on which the val­ues are plot­ted as a range of col­ours: red for few­er vis­it­ors, green for more vis­it­ors.


analytics-octoberThose dips you saw on the line graph? Those were Sundays, when brows­ing activ­ity di­ves down con­sist­ently. However, as you can see from above, not all Sundays are equal. July 31st and August 7th, though they were Sundays, had con­sid­er­able traf­fic. Similarly, week­days can also ex­per­i­ence dips. Jun 23rd is an ex­ample of a some­what un­usu­al dip, and so is Oct 26th – Diwali.

Calendar heat­maps provide a way of ex­plor­ing in­form­a­tion at a far rich­er level of de­tail than tra­di­tion­al line graphs or bar graphs do.

For ex­ample, they fo­cus on weekly trends. In busi­nesses where there is a weekly cyc­lic­al­ity, it be­comes much easi­er to spot an un­usu­al week­day. In the month of August (see be­low), it’s fairly ob­vi­ous from both graphs that August 14th had a bad dip. But what be­comes clear­er from the cal­en­dar map (but not the line graph) is that August 13th was a re­l­at­ively bad Saturday, and August 16th was a re­l­at­ively bad Tuesday.


analytics-octoberSecondly, they fo­cus on in­di­vidu­al days. Its a lot easi­er to see the ex­act date on which an event oc­curred. For ex­ample, in the graph along­side, there has been a big dip in October. The most sig­ni­fic­ant has been in the last week, spe­cific­ally on October 26th. Once you know the date, it’s easy to as­so­ci­ate the change in be­ha­vi­our with Diwali as its cause.

On the line graph be­low, you can see the ma­jor dip in October. However, map­ping this spe­cific­ally to Diwali is a far tougher task.


Below is an­other cal­en­dar heat­map – this time, show­ing the per­cent­age of vis­it­ors from New Delhi. Consider the month of August. We saw from the earli­er cal­en­dar map that there was a de­cline in traf­fic between August 13 – 16. If that de­crease was uni­form across cit­ies, the col­ours be­low would be uni­form too. However, New Delhi’s per­cent­age share de­clines as well on these days.


Apparently, the people at New Delhi are more likely to spend the day out­side on Independence Day than most oth­er cit­ies! In fact, they seem to spend the whole of August avoid­ing brows­ing. However, the same can­not be dur­ing of Diwali. Delhi-ites are as likely / un­likely to be brows­ing dur­ing Diwali as any den­iz­ens of any oth­er city.

The next time you look at data with weekly pat­terns, where you need to fig­ure out quickly when ex­actly the num­bers rose or fell, do try out a cal­en­dar heat­map.

Leave a Reply