-
Book Overview & Buying
-
Table Of Contents
Visualforce Development Cookbook - Second Edition
By :
In the previous recipes in this chapter, each chart contained a single series. Visualforce charts are not limited to this and can plot multiple sets of data, regardless of whether there is a relationship between the data sets.
In this recipe, we will create a Visualforce page containing a chart that plots two series against the month for the last year. The first is a bar series of the number of opportunities lost in the month, while the second is a line series of the number of opportunities won in the month. This allows a sales director to see if the won/lost ratio is improving over time.
This recipe makes use of a custom controller, so this must be present before the Visualforce page can be created.
Navigate to the Apex Classes setup page by clicking on Your Name | Setup | Develop | Apex Classes.
Click on the New button.
Paste the contents of the MultiSeriesChartController.cls Apex class from the code download into the Apex Class area.
Click...