Dynamic Gauge in salesforce banner
Blogs

Dynamic Gauge in salesforce

Contact Us
Mirketa1 min read

Salesforce provides us standard functionality to create Reports and dashboards to represent records in diagrammatic form. Sometimes we face the requirement to represent our data in diagrammatic Form on visual force page in some specific type of diagram we represent it using the chart. Salesforce provide us Bar chart, Pie chart, Gauge chart, Radar charts

Here I am going to explain how we can represent specific field data in the form of a gauge chart. To achieve this requirement we need four things basically. First, we should have an object whether it’s a standard or custom object, a field associated with that object that should hold any numeric Value, apex controller, apex class.

I will start with an object lets say I have a standard controller Account where I have a custom field Score and I need to represent that score in the form of gauge. Whenever page loads that value represents in the form of gauge and whenever the fields value changes the gauge should reflect that Change.

So the items that we have is:

  1. Standard object: Account.
  2. Custom Field : score__c,score1__c
  3. Apex controller: TestPageController1.
  4. Visualforce page: gauge.

First of all the code for the controller that we will need is:

We have created a controller named GaugeController.

Get Started

Have Questions? Let's Talk

Share a few details about your goals: a Mirketa consultant will follow up within one business day.

  • A specialist follows up within one business day
  • A no-obligation conversation about your specific goals
  • Answers from someone who actually works in this space
  • Your information stays confidential
Certified PartnerSOC 2 CertifiedHIPAA ReadyEnterprise Ready

Schedule a Free Consultation