Skip to main content
added 858 characters in body
Source Link
jaw999
  • 1.3k
  • 2
  • 22
  • 50

I have two fields on my Account page, one is a Roll Up Sum and one is a Formula field that I'd like to push into a bar chart. They are both of currency format. Do I need to use a controller class to get the two fields as data? All examples I see are based on queries of series of objects, or hard coded examples. Thanks for assisting.

Draft page:

<apex:page standardController="Account" >
<script>

var dataArray = new Array();
dataArray.push({'data1':{!Account.NumberofEmployees},'name':'EMP'});
dataArray.push({'data1':{!Account.X2014_Net_Revenue__c},'name':'LOCS'});

</script>

<apex:chart data="dataArray" height="200px" width="200px">
<apex:legend position="left"/>
<apex:axis type="Numeric" position="left" title="YoY" grid="true"
    fields="data1" dashSize="2">
    <apex:chartLabel />
</apex:axis>
<apex:axis type="Category" position="bottom" fields="name" title="Stacked Bars">
    <apex:chartLabel rotate="315"/>
</apex:axis>
<apex:barSeries orientation="vertical" axis="left" stacked="true"
    xField="name" yField="data1" title="2013,2014"/></apex:chart>
</apex:page>

I have two fields on my Account page, one is a Roll Up Sum and one is a Formula field that I'd like to push into a bar chart. They are both of currency format. Do I need to use a controller class to get the two fields as data? All examples I see are based on queries of series of objects, or hard coded examples. Thanks for assisting.

I have two fields on my Account page, one is a Roll Up Sum and one is a Formula field that I'd like to push into a bar chart. They are both of currency format. Do I need to use a controller class to get the two fields as data? All examples I see are based on queries of series of objects, or hard coded examples. Thanks for assisting.

Draft page:

<apex:page standardController="Account" >
<script>

var dataArray = new Array();
dataArray.push({'data1':{!Account.NumberofEmployees},'name':'EMP'});
dataArray.push({'data1':{!Account.X2014_Net_Revenue__c},'name':'LOCS'});

</script>

<apex:chart data="dataArray" height="200px" width="200px">
<apex:legend position="left"/>
<apex:axis type="Numeric" position="left" title="YoY" grid="true"
    fields="data1" dashSize="2">
    <apex:chartLabel />
</apex:axis>
<apex:axis type="Category" position="bottom" fields="name" title="Stacked Bars">
    <apex:chartLabel rotate="315"/>
</apex:axis>
<apex:barSeries orientation="vertical" axis="left" stacked="true"
    xField="name" yField="data1" title="2013,2014"/></apex:chart>
</apex:page>
Source Link
jaw999
  • 1.3k
  • 2
  • 22
  • 50

Visualforce Chart for Values on the Account page

I have two fields on my Account page, one is a Roll Up Sum and one is a Formula field that I'd like to push into a bar chart. They are both of currency format. Do I need to use a controller class to get the two fields as data? All examples I see are based on queries of series of objects, or hard coded examples. Thanks for assisting.