+ Start a Discussion
leah brooks 11leah brooks 11 

Create a custom graph in location

I have been tasked with setting up two customer graphs in every one of our location in salesforce.  One, that will instantly show how many cases are open, and what status they are in.  THis one I did fairly easily with a report that I added to the page layout.

The other ask though is for a graph that will display the overall 'health' of the location.  Basically what they need with this is a simple indicator that will go from red/yellow/green along with a percentage marker that shows how will the location is running.  Behind the scenes, this indicator will be based off of three seperate factors:  How many times the location has been marked as 'down', what the average open to close time is on cases, and how many cases.  All of these factors for now are going to be pulled from the current week.

I'm not sure how to do this.   I don't think it would be possible to do it with just a simple report, but I'm not sure what other tools that salesforce has that could do something like this.  Does anyone have any ideas?  Anything would be greatly appreciated!

Thank you!
Best Answer chosen by leah brooks 11
VineetKumarVineetKumar
Try this page and check
<apex:page standardController="SVMXC__Site__c">
    <apex:iframe src="https://na15.salesforce.com/servlet/servlet.ChartServer?rsid=0FLi0000001Mkfg&ruid=005i0000007OgoP&did=01Zi0000000NCzH&s=7&fs=10&tfg=12&tfs=-16777216&explode=0&c=gauge&cs=0&title=Overall+Health+Indicator&eh=no&compo=no&fg=-16777216&bg1=-1&bg2=-1&bgdir=2&dl1=Location%3A+Location+Name&dl2=&l=2&sax=yes&Yman=no&nc=0&actUrl=%2F00Oi0000006bCgq%3Fdash_f0%3D0ICi00000008ir1%26dash_fc0%3DFK_NAME&sd=1&scv=no&sct=no&spt=yes&bd=yes&cu=USD&ab=X&u=0&vt=0&ab2=Y&u2=0&vt2=0&vl0=Location+Health+Meter&spoc=no&topn=no&gm=0.0&gc0=-11222444&gm0=10.0&gc1=-4013484&gm1=30.0&gc2=-4041644&gm2=50.0&sona=0&refreshts=1469032304000" height="200" frameborder="false"/>
</apex:page>

All Answers

leah brooks 11leah brooks 11
Just as a visual, this is something like what I am thinking, not necessarily exactly how it has to look, but an idea:

Potential Dashboard
VineetKumarVineetKumar
Checkout dashboards in salesforce
leah brooks 11leah brooks 11
As far as I can tell dashboards is for reports, or 'dashboards' that appear on the main screen.  

What I need is a gauge in the location, alongside another report with a  chart that I have already made.  I need this second report to be based off of a formula that pulls three different metrics from the current week.  From what I know of charts and reports, I am unable to find a way to do this.
VineetKumarVineetKumar
Dashboards provide a graphical view of the data in your reports. It is not just limited to to appearing on the main screen, there can be standalone dashboards that are not visible on the Home Page. 
Also, your dashboard can contain multiple reports and charts originating from different reports (combination of charts, gauge, tabular reports etc.)
leah brooks 11leah brooks 11
So is it possible for me to embed a dashboard into an object (i.e. the location object)  that was what I originally wanted to do but could not find a way to do it
VineetKumarVineetKumar
Not sure as to what you meant by that.
But you can build a repoty on your object and utilise that report to generate different types of dashboards.
leah brooks 11leah brooks 11
If you look in page layout there is an option where you can embed charts (charts, not dashboards, as far as I am aware) in your different objects that have layouts which support them.  For example, I have a location page which has multiple different fields and subcatagories, I embedded a chart, shown below, into this location so that I can see at a glance information about that location without having to scroll through everything.

User-added image

Now however, what I'd like to do is embed a health status indicator in the location.  Unfortunately there is not a chart on the default reports that is in the format which I need:

User-added image

I was able to make a dashboard, but since I need it to be an at-a-glance-chart that is embedded in the actual location, the dashboard does not do me any good.

My question then is, does anyone know how to embed a chart like the above into an object like we can embed all the other charts that come with the reports feature?

Thank you.
VineetKumarVineetKumar
Yes this can totally be done.
You need to embed your salesforce dashboard to a VF page as an <iframe>, and add this VF page to the location object record page layout.

Not sure if you have the coding expertise, but you can refer the below youtube link :
https://www.youtube.com/watch?v=IBQcywsJ0OE

Do mark my answer as best answer, if it helped solve your problem.
leah brooks 11leah brooks 11
This looks like it's going to work!  I do have one question though.  At about two minutes into the video you referenced they pull up a window where they start making the visualforce page.  Where do I have to go to get that window to open?  Thank you!
VineetKumarVineetKumar
Setup > Develop > Visualforce Pages
leah brooks 11leah brooks 11
Perfect, thank you. One more question. I got the dashboard embedded into a visual force page, but when I go into my page layout to put the page into my ‘location’ page, I’m not seeing the new visual force page that I just made under the visualforce page header. Did I miss something? Thank you for all your help!
VineetKumarVineetKumar
Did you refer the standardController to the page as the name of the object?
leah brooks 11leah brooks 11
I’m sorry, I honestly do not know what that means. So possibly not…
VineetKumarVineetKumar
Can you refer your page here, and also the API name of the object where you wanna add this VF page.
leah brooks 11leah brooks 11
Yes, here's the page:
 
<apex:page >
    <apex:iframe src="https://na15.salesforce.com/servlet/servlet.ChartServer?rsid=0FLi0000001Mkfg&ruid=005i0000007OgoP&did=01Zi0000000NCzH&s=7&fs=10&tfg=12&tfs=-16777216&explode=0&c=gauge&cs=0&title=Overall+Health+Indicator&eh=no&compo=no&fg=-16777216&bg1=-1&bg2=-1&bgdir=2&dl1=Location%3A+Location+Name&dl2=&l=2&sax=yes&Yman=no&nc=0&actUrl=%2F00Oi0000006bCgq%3Fdash_f0%3D0ICi00000008ir1%26dash_fc0%3DFK_NAME&sd=1&scv=no&sct=no&spt=yes&bd=yes&cu=USD&ab=X&u=0&vt=0&ab2=Y&u2=0&vt2=0&vl0=Location+Health+Meter&spoc=no&topn=no&gm=0.0&gc0=-11222444&gm0=10.0&gc1=-4013484&gm1=30.0&gc2=-4041644&gm2=50.0&sona=0&refreshts=1469032304000" height="200" frameborder="false"/>
</apex:page>
and this is the api name of my custom location page:  "SVMXC__Site__c"
 
VineetKumarVineetKumar
Try this page and check
<apex:page standardController="SVMXC__Site__c">
    <apex:iframe src="https://na15.salesforce.com/servlet/servlet.ChartServer?rsid=0FLi0000001Mkfg&ruid=005i0000007OgoP&did=01Zi0000000NCzH&s=7&fs=10&tfg=12&tfs=-16777216&explode=0&c=gauge&cs=0&title=Overall+Health+Indicator&eh=no&compo=no&fg=-16777216&bg1=-1&bg2=-1&bgdir=2&dl1=Location%3A+Location+Name&dl2=&l=2&sax=yes&Yman=no&nc=0&actUrl=%2F00Oi0000006bCgq%3Fdash_f0%3D0ICi00000008ir1%26dash_fc0%3DFK_NAME&sd=1&scv=no&sct=no&spt=yes&bd=yes&cu=USD&ab=X&u=0&vt=0&ab2=Y&u2=0&vt2=0&vl0=Location+Health+Meter&spoc=no&topn=no&gm=0.0&gc0=-11222444&gm0=10.0&gc1=-4013484&gm1=30.0&gc2=-4041644&gm2=50.0&sona=0&refreshts=1469032304000" height="200" frameborder="false"/>
</apex:page>
This was selected as the best answer
leah brooks 11leah brooks 11
That worked! Thank you! I do still have another question though… ☺ The other chart that I have in the location is filtered by location, so it is specific to the location that it is displayed in. Will this new chart be like that? How do I know what it is filtering? Also is there a way to make it bigger? [cid:image001.png@01D1E331.909D5DF0] Thank you so much for your help!
leah brooks 11leah brooks 11
User-added image
VineetKumarVineetKumar
Yes, you can increase the size, the place where you added the VF page (while editing the page layout), a you will hover over the section you might see a tool sign, click on it to specify the pixels.
For your charts how are you passing in the location?
leah brooks 11leah brooks 11
This is the method that I was using to pass in the location of the chart:
 
<apex:page standardController="SVMXC__Site__c">
<apex:iframe src="https://na15.salesforce.com/servlet/servlet.ChartServer?rsid=0FLi0000001Mkfg&ruid=005i0000007OgoP&did=01Zi0000000NCzH&s=7&fs=10&tfg=12&tfs=-16777216&explode=0&c=gauge&cs=0&title=Overall+Health+Indicator&eh=no&compo=no&fg=-16777216&bg1=-1&bg2=-1&bgdir=2&dl1=Location%3A+Location+Name&dl2=&l=2&sax=yes&Yman=no&nc=0&actUrl=%2F00Oi0000006bCgq%3Fdash_f0%3D0ICi00000008ir1%26dash_fc0%3DFK_NAME&sd=1&scv=no&sct=no&spt=yes&bd=yes&cu=USD&ab=X&u=0&vt=0&ab2=Y&u2=0&vt2=0&vl0=Location+Health+Meter&spoc=no&topn=no&gm=0.0&gc0=-11222444&gm0=10.0&gc1=-4013484&gm1=30.0&gc2=-4041644&gm2=50.0&sona=0&refreshts=1469032304000" height="200" frameborder="false"/>
</apex:page>

I believe that all this is doing however is posting the 'picture' of the chart.  After doing some of my own research on the web, I stumbled across this page (https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_charting.htm)  from what I read here I believe that my best bet to have an accurate chart on every page would be actually writing the code to create a spedometer style chart.  I am struggling to figure out what kind of code I need to write to do this however.  

Can I just have the "SVMXC__Site__c" as the controller and then write in a simple formula to determine the charts output?