Creating a bar chart

Bar charts allow easy comparison of groups of data. A typical use in Salesforce is to view performance on a month-by-month basis; for example, to identify the effectiveness of a process improvement.

In this recipe, we will create a Visualforce page containing a bar chart that displays the total value of opportunities won per month for the previous 12 months. This allows a sales manager to view at a glance whether sales are increasing or decreasing and to identify any problem months that require further analysis.

Getting ready

This recipe makes use of a custom controller so this must be created before the Visualforce page.

How to do it...

  1. Navigate to the Apex Classes setup page by clicking on Your Name | Setup | Develop | Apex Classes ...

Get Visualforce Development Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.