function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vadivel MuruganVadivel Murugan 

Trend Line report in visualforce page

Hello,

Any one know how to create a trend line report in visualforce page. Or if anyone know how to implement the jqwidgets in visualforce page report.

http://www.jqwidgets.com/blog/
NagaNaga (Salesforce Developers) 
Hi Vadivel,

Reports and dashboards display how you performed in the past and what’s happening at the moment. They are important to driving success and implementation of any CRM project. The information provided by reports and dashboards is especially important in today’s arena, where it’s critical to be proactive, rather than reactive, in your approach. You want to be able to spot trends and act on them immediately.

Business Use case :- Higher management in Universal Container wants to use “Opportunity trends” report chart on a Visualforce Page.

Solution of above business requirement 

After Sprin’14 release, you can use  report Report Chart (That is created by using the report builder) in any Visualforce page, with only a single line of code. Report Chart can include dynamic filters, auto-refresh based on expiration time, and many other options. With this enhancement, all of your most critical Chart and analytics is in the background, wherever you are working. You no longer need workarounds such as iframes or Javascript to create a Visualforce page with dashboard-like functionality. You can just pull the chart into your Visualforce component by its report ID.  Follow the below instruction to complete this requirement

Create a Report with Chart . If you don’t to how to do that please go through my article Embedding Charts Anywhere
Copy the report ID, you can get a report’s ID from the report URL in Salesforce, or request it through the API.
Now create a Visualforce page and use Visualforce tag <analytics:reportChart> with attribute reportID


Code:-

 <apex:page >
<analytics:reportChart reportId=”00Ox0000000i8gv” size=”small”></analytics:reportChart>
</apex:page>

Please let me know if this helps

Best Regards
Naga Kiran
Amit Chaudhary 8Amit Chaudhary 8
Please check below blog:-
http://www.infallibletechie.com/2013/02/pie-chart-and-bar-chart-using-apex-in.html

Visualforce page:
<apex:page controller="Graph" >
    <apex:pageblock title="Members and their Years of experience" >
        <apex:chart height="250" width="350" data="{!pieData}"> 
            <apex:pieSeries tips="true" dataField="data" labelField="name"/> 
            <apex:legend position="bottom"/>
        </apex:chart>
    </apex:pageblock>
                        
    <apex:pageblock title="Members and their Years of experience" >
        <apex:chart height="250" width="350" data="{!pieData}"> 
            <apex:axis type="Numeric" position="left" fields="data" title="Years of experience"/>    
            <apex:axis type="Category" position="bottom" fields="name" title="Member"/>            
            <apex:barSeries orientation="vertical" axis="left" xField="name" yField="data"/> 
        </apex:chart>
    </apex:pageblock>            
</apex:page>

Apex Controller:
 
public with sharing class Graph 
{  
    public List<PieWedgeData> getPieData() 
    {  
        List<PieWedgeData> data = new List<PieWedgeData>();
        List<Member__c> memb = new List<Member__c>();  
        
        String sql = 'SELECT Name, Year_s_Of_Experience__c FROM Member__c';
        memb = Database.Query(sql);
        for(Member__c temp:memb)
        {           
            data.add(new PieWedgeData(temp.Name,temp.Year_s_Of_Experience__c));
        }
        return data;  
    }  
    
    // Wrapper class  
    public class PieWedgeData 
    {  
        public String name { get; set; }  
        public Decimal data { get; set; }  
        
        public PieWedgeData(String name, Decimal data) 
        {  
            this.name = name;  
            this.data = data;  
        }  
    }  
}

Please let us know if this will help you.

Thanks
Amit Chaudhary
Vadivel MuruganVadivel Murugan
But in this condition not trend line can be add my chart. But i want trend line to add my already created report chart.