Skip to main content

Visualforce reportChart Component

About Us
Published by admin
27 January 2017
311

This component is used to add Salesforce report charts to a Visualforce page. There is an option for data filtering in case you want to see 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.

First of all, you need to enter reportId (The unique ID of the report) or developerName (The unique developer name of the report), to set report for your reportChart.

Then you can set some filters to show only necessary information, using attribute filter. A report can have up to 20 field filters. A filter has these attributes in the form of a JSON string:

  • column: The API name of the field that you want to filter on.
  • operator: The API name of the condition you want to filter a field by. For example, to filter by "not equal to," use the API name "notEqual."
  • value: The filter criteria.

For example, [{column:'STAGE_NAME', operator:'equals', value:'Prospecting'}, {column:'EXP_AMOUNT', operator:'greaterThan', value:'75000'}].

Attribute body is the body of the component. In markup, this is everything in the body of the tag.
It is a good idea to set hideOnError=”true”, if you don’t want users to see errors related to the chart. If an error occurs, the chart will not be displayed.
Attribute rendered can be used to show or to hide your chart. You can use a formula here.
Attribute size specifies a chart’s size with one of these values: tiny, small, medium, large, huge.
Attribute showRefreshButton is a Boolean indicating whether to add a refresh button to the chart. It is true by default.
If you want to enable cache, you should set cacheResults=”true”. When the attribute is set to true, data is cached for 24 hours, but you can modify the length of time with the cacheAge (in milliseconds) attribute. The maximum length of time is 24 hours. If the attribute is set to false, the report is run every time the page is refreshed.

Using component on Visualforce page might look like this: <analytics:reportChart reportId="00O28000001BC2N" showRefreshButton="true" size="tiny" hideOnError="true"/>.

And here is a result:

 result

We can use some filters: <analytics:reportChart reportId="00O28000001BC2N" showRefreshButton="true" size="tiny" hideOnError="true" filter="[{column:'AMOUNT', operator:'equals', value:'15000'}]"/>.

And here is a result:

And here is a result:


image
Question to the expert
image

We have available resources to start working on your project within 5 business days

1 UX Designer

image

1 Admin

image

2 QA engineers

image

1 Consultant

image
Related Articles
All articles
image
Is Salesforce Winning the Public Sector Race?
An analysis of Salesforce's rapid expansion into the U.S. public sector, tracing its path from cautious early government licensing deals in the 2010s through the launch of Government Cloud in 2012, its pivotal role in COVID-19 vaccine rollouts, and its 2025–2026 push into military and intelligence work via Agentforce and Missionforce. The piece covers major 2026 contracts — including a $5.6 billion Army deal, a $1.6 billion VA agreement, and Pentagon Impact Level 5 authorization — alongside real-world case studies like California's REAL ID processing and the UK's NHS back-office operations. It also examines the structural obstacles still facing Salesforce and other vendors in government tech: legacy IT systems decades old, outdated federal procurement rules, budget constraints, and organizational caution around AI adoption, plus the competitive pressure from Palantir, Microsoft, and Oracle in the race for public sector AI spending.
28 August 2026
image
Why Your Salesforce Flows Are Agentforce's Biggest Problem
This article argues that the most underestimated risk in Agentforce deployments isn't data quality — it's the automation layer: years of overlapping Flows, Process Builder processes, Apex triggers, and managed package logic that no one has reviewed end-to-end. It explains why AI agents inherit automation complexity without the tribal knowledge human admins carry, why technical debt only becomes visible after an agent hits it in production, and why a clean demo is no indicator of production readiness. The article closes with a concrete, tool-by-tool inventory approach using Flow Trigger Explorer, Salesforce Optimizer, Setup Audit Trail, Apex Debug Logs, Agent Builder, and Health Check — scoped to the specific processes the agent will actually use rather than the whole org.
23 July 2026
image
How to Wire Multiple Salesforce Projects in One Org Without Breaking Everything
This article maps the real integration patterns that emerge when multiple Salesforce projects — both managed packages and unpackaged code — share a single org. It covers four concrete patterns: attaching custom triggers to package-owned objects, calling global members exposed by managed packages, writing directly into another project's objects, and runtime-guarded reads of package data. It then addresses access control for authenticated and guest users, including the Master-Detail wall and the without sharing elevation pattern. The piece closes with eight concrete risks (compile-time dependencies that block uninstall, upgrade coupling, silent cascade failures, access invisible to admins) and six actionable recommendations for keeping cross-project coupling manageable.
08 July 2026