Use this component to add Salesforce report charts to a Visualforce page. You can filter chart data to show specific results. The component is available in API version 29.0 or later.
Before you add a report chart, check that the source report has a chart in Salesforce app.
Attribute Name | Attribute Type | Description | Required? | API Version | Access |
---|---|---|---|---|---|
body | Component[] | The body of the component. In markup, this is everything in the body of the tag. | 29.0 | global | |
cacheAge | Long | The length of time that an embedded chart can cache data, in milliseconds (for example, 24 hours = 86,400,000 ms). The maximum length of time is 24 hours. | 29.0 | global | |
cacheResults | Boolean | A Boolean indicating whether to use cached data when displaying the chart. When the attribute is set to true, data is cached for 24 hours, but you can modify the length of time with the cacheAge attribute. If the attribute is set to false, the report is run every time the page is refreshed. | 29.0 | global | |
developerName | String | The unique developer name of the report. You can get a report’s developer name from the report properties in the Report Builder. This attribute can be used instead of reportId. It can't be included if reportId has been set and vice versa. One of the two is required. | 29.0 | global | |
error | String | Whether this is error for fetching the component | 29.0 | global | |
filter | String | Filter a report chart by fields in addition to field filters already in the report to
get specific data. Note that a report can have up to 20 field
filters. A filter has these attributes in the form of a JSON string:
To get the API name of the field and the operator, make a describe request via the Analytics REST API or Analytics Apex Library as shown in these examples:
Analytics
API
/services/data/v29.0/analytics/reports/00OD0000001ZbNHMA0/describe
Analytics Apex Library
|
29.0 | global | |
hideOnError | Boolean | Use the attribute to control whether users see a chart that has an error. When
there’s an error and this attribute is not set, the chart will not
show any data except the error. An error can happen for many reasons, for example, when a user doesn’t have access to fields used by the chart or a chart has been removed from the report. Set the attribute to true to hide the chart from a page. |
29.0 | global | |
rendered | Boolean | A Boolean value that specifies whether the component is rendered on the page. If not specified, this value defaults to true. | 14.0 | global | |
reportId | String | The unique ID of the report. You can get a report’s ID from the report URL in Salesforce, or request it through the API. | 29.0 | global | |
showRefreshButton | Boolean | A Boolean indicating whether to add a refresh button to the chart. | 29.0 | global | |
size | String | Specify a chart’s size with one of these values:
|
29.0 | global |