We suggest a formula field, while you are struggling to create progress bar through coding. You can achieve the progress bar without coding easily by using the below steps it is possible in Salesforce.
Here we explained the progress bar based on ‘Marks’.
White color image Colored image
Step -1: Create two image files, one is white color image and then another one with a colored image (using ‘paint’) and save as .png or .jpg format.
Step – 2: Store the above two images in ‘Static Resources’.
Step – 3: First you create the below fields on an Object.
• Field Name like that ‘Marks’ and ‘Progress Bar’ have data type like ‘Number’ and ‘Formula’ respectively.
• Select ‘Text’ type on Formula field.
Step – 4: Type the below code on formula field
• Paste the two different image URL from static resource images like that ‘colored image’ and ‘whiteimage’ respectively in the highlighted green color places.
IMAGE(‘https://c.ap2.visual.force.com/resource/1475142787000/coloredimg’,”Status”,10,Marks__c)&
IMAGE(‘https://c.ap2.visual.force.com/resource/1475143822000/emptyimg’,”Status”,10,(100-Marks__c))& ‘ ‘&Text(Marks__c) & ‘%’
Step – 5: See the below sample output of Progress Bar.
——————————————*** Thank You*** ——————————————-