Newer Version Available
Create Visualforce Dashboard Components
Use Visualforce pages as dashboard components. A dashboard shows data
from source reports as visual components, such as charts, gauges, tables, metrics, or
Visualforce pages. The components provide a snapshot of key metrics and performance
indicators. Each dashboard can have up to 20 components.
| Available in: Salesforce Classic (not available in all orgs) |
| Available in: all editions |
-
Create a Visualforce page called VFDashboard.
The Visualforce page uses a standard list controller, so you can add it to a dashboard. It displays a list of the cases associated with your org.
1<apex:page standardController="Case" recordSetvar="cases"> 2 <apex:pageBlock> 3 <apex:form id="theForm"> 4 <apex:panelGrid columns="2"> 5 <apex:outputLabel value="View:"/> 6 <apex:selectList value="{!filterId}" size="1"> 7 <apex:actionSupport event="onchange" rerender="list"/> 8 <apex:selectOptions value="{!listviewoptions}"/> 9 </apex:selectList> 10 </apex:panelGrid> 11 <apex:pageBlockSection> 12 <apex:dataList var="c" value="{!cases}" id="list"> 13 {!c.subject} 14 </apex:dataList> 15 </apex:pageBlockSection> 16 </apex:form> 17 </apex:pageBlock> 18</apex:page> - Build a Salesforce Classic dashboard.
-
Add the Visualforce page to a dashboard.
- Click the Dashboards tab.
- On the dashboard where you want to add the Visualforce page component, click Edit.
- From the Components tab, drag Visualforce Page onto your dashboard.
- From the Data Sources tab, click the Visualforce Pages dropdown, and drag VFDashboard onto the component that you just added to the dashboard.
- Optionally, enter a header or footer to display on the Visualforce dashboard component.
- Save your changes.

For a more complex example that uses a custom list controller, see Create Advanced Visualforce Dashboard Components.