Visualforce charts can be generated wherever a Visualforce page can be displayed, including sidebar components, the homepage, and in standard record view pages.
In this recipe, we will create a Visualforce page containing a chart that displays a stacked bar chart containing the total number of activities carried out with a contact per month for the last year. The stacked bars contain a segment for the events and tasks that make up the activity total. This Visualforce page is embedded into the standard contact record view page to allow a sales manager to see at a glance whether a contact is being neglected or receiving more than its fair share of attention.
This recipe makes use of a controller extension that must be present before the Visualforce page can be created.