You need to sign in to do that
Don't have an account?
Girbson Bijou 8
Chart does not dispay
My code are saved without error but the chart does not display in the VF page
portion of the VF page:
portion of the VF page:
<apex:page renderAs="pdf" showHeader="false" sidebar="false" applyBodyTag="false" standardStylesheets="True" Controller="ContainerGlobalShipmentController"> <div class="head"> <div class="col logo"> <apex:image url="{!$Resource.LogoFFP}" width="140" height="60"/> </div> <div class ="col name"> <h2> FOOD FOR THE POOR - HAITI </h2> <h6> 14, Mapou Rte. Nationale #1, Cap Haitien, Haiti <br/> Tels:(+509)2208-9960/3409-5328 </h6> </div> </div> <div class="firstBlock" > <div class ="SubfirstBlock"> <b><i>Total Containers: {!TotalContainer}</i></b> <br/> Containers In Transit : {!AwaitingArrival} <br/> Containers at Wharf: {!ContainerAtWharf} <br/> Containers at Warehouse : {!ContainerAtWarehouse}<br/> Containers Returned to wharf last 5 Days : {!departed} </div> <div class ="SubfirstBlock"> <div> <h2>Shipment Update <apex:outputtext value="{0, date, long}"> <apex:param value="{!NOW()}"></apex:param> </apex:outputtext> </h2> </div> </div> </div> <br/> //Chart <apex:chart height="350" width="450" data="{!pieData}"> <apex:pieSeries dataField="data" labelField="name"/> <apex:legend position="right"/> </apex:chart> <table style="width:100%;border-collapse: collapse; border: 0px solid black;"> <tr> <th>System Code</th> <th>Ref#</th> <th>Lead/PO</th> <th>Invoice#</th> <th>Container#</th> <th>Size</th> <th>Shipper</th> <th>Description</th> <th>Bill of Lading No</th> <th>On Wharf</th> <th>Sailing</th> <th>ETA</th> <th>Demurrage</th> <th>Broker</th> <th>Consignee</th> </tr> <apex:repeat var="key" value="{!Records}"> <tr><th style="background: Gray; color:white; text-transform:uppercase;"><b> {!key}</b></th> <th style="background: Gray; color:white; text-transform:uppercase;"><b> </b></th> <th style="background: Gray; color:white; text-transform:uppercase;"><b> </b></th> <th style="background: Gray; color:white; text-transform:uppercase;"><b> </b></th> <th style="background: Gray; color:white; text-transform:uppercase;"><b> </b></th> <th style="background: Gray; color:white; text-transform:uppercase;"><b> </b></th> <th style="background: Gray; color:white; text-transform:uppercase;"><b> </b></th> <th style="background: Gray; color:white; text-transform:uppercase;"><b> </b></th> <th style="background: Gray; color:white; text-transform:uppercase;"><b> </b></th> <th style="background: Gray; color:white; text-transform:uppercase;"><b> </b></th> <th style="background: Gray; color:white; text-transform:uppercase;"><b> </b></th> <th style="background: Gray; color:white; text-transform:uppercase;"><b> </b></th> <th style="background: Gray; color:white; text-transform:uppercase;"><b> </b></th> <th style="background: Gray; color:white; text-transform:uppercase;"><b> </b></th> <th style="background: Gray; color:white; text-transform:uppercase;"><b> </b></th> </tr> <apex:repeat value="{!Records[key]}" var="c"> <tr> <td style="border: 0.08px solid gray;">{!c.ID_Container__c}</td> <td>{!c.Pkl__c}</td> <td>{!c.PO__c}</td> <td>{!c.Invoice__c}</td> <td>{!c.Name}</td> <td>{!c.Size_in_feet__c}</td> <td>{!c.Shipper__r.Name} </td> <td>{!c.Description__c}</td> <td>{!c.Bill_of_Lading__c}</td> <td>{!c.On_Wharf_Date__c}</td> <td>{!c.Sailing__c}</td> <td>{!c.ETA__c} </td> <td>{!c.Demurrage_begins__c}</td> <td>{!c.Brocker__c}</td> <td>{!c.Consignee__c}</td> </tr> </apex:repeat> </apex:repeat> </table> <h4><center> <i><b>List of containers returned to wharf during the last 5 days</b></i></center></h4><br/> <table style="width:100%;border-collapse: collapse; }"> <tr> <th style="background: gray; color:white;">System Code</th> <th style="background: gray; color:white;">Ref#</th> <th style="background: gray; color:white;">Lead/PO</th> <th style="background: gray; color:white;">Invoice#</th> <th style="background: gray; color:white;">Container#</th> <th style="background: gray; color:white;">Size</th> <th style="background: gray; color:white;">Shipper</th> <th style="background: gray; color:white;">Description</th> <th style="background: gray; color:white;">Bill of Lading No</th> <th style="background: gray; color:white; ">On Wharf</th> <th style="background: gray; color:white; ">Returned to Wharf</th> <th style="background: gray; color:white; ">Sailing</th> <th style="background: gray; color:white; ">ETA</th> <th style="background: gray; color:white; ">Demurrage</th> <th style="background: gray; color:white; ">Broker</th> <th style="background: gray; color:white; ">Consignee</th> </tr> <apex:repeat var="d" value="{!lstDepartedLast5Days}"> <tr> <td>{!d.ID_Container__c}</td> <td>{!d.Pkl__c}</td> <td>{!d.PO__c}</td> <td>{!d.Invoice__c}</td> <td>{!d.Name}</td> <td>{!d.Size_in_feet__c}</td> <td>{!d.Shipper__r.Name} </td> <td>{!d.Description__c}</td> <td>{!d.Bill_of_Lading__c}</td> <td>{!d.On_Wharf_Date__c}</td> <td><apex:outputtext value="{0, date, long}"> <apex:param value="{!d.Date_Return_to_wharf__c }"></apex:param> </apex:outputtext></td> <td>{!d.Sailing__c}</td> <td>{!d.ETA__c} </td> <td>{!d.Demurrage_begins__c}</td> <td>{!d.Brocker__c}</td> <td>{!d.Consignee__c}</td> </tr> </apex:repeat> </table> <div class="footer"> <div> Printed by : {!$User.FirstName} {!$User.LastName} <apex:outputtext value="{0, date, long}"> <apex:param value="{!NOW()}"></apex:param> </apex:outputtext> at {!TIMENOW()} GMT <br/> As often as you did it for one of my least brothers, you did it for me. Matthiew 25:40 <br/> </div> </div> </apex:page> // Controller public class ContainerGlobalShipmentController{ public integer AwaitingArrival { get; set; } public integer waitintingForClearance { get; set; } public integer readyToGoWarehouse { get; set; } public integer notOffload{ get; set; } public integer offload { get; set; } public integer departed { get; set; } public integer ContainerAtWharf { get; set; } public integer TotalContainer { get; set; } public integer ContainerAtWarehouse { get; set; } public String Account { get; set; } public List<Container__c> lstDepartedLast5Days { get; set; } public Map<String, List<Container__c>> Records { get; set; } public ContainerGlobalShipmentController() { //ContainerAtWharf = [SELECT COUNT() FROM Container__c WHERE Provenance__c ='FFP FLORIDA' AND Shipment_Status__c ='B - WAITING FOR CUSTOMS CLEARANCE' AND Shipment_Status__c ='C - READY TO GO TO WAREHOUSE']; AwaitingArrival = [SELECT COUNT() FROM Container__c WHERE Provenance__c ='FFP FLORIDA' AND Shipment_Status__c ='A - AWAITING ARRIVAL' ]; waitintingForClearance = [SELECT COUNT() FROM Container__c WHERE Provenance__c ='FFP FLORIDA' AND Shipment_Status__c ='B - WAITING FOR CUSTOMS CLEARANCE']; readyToGoWarehouse= [SELECT COUNT() FROM Container__c WHERE Provenance__c ='FFP FLORIDA' AND Shipment_Status__c ='C - READY TO GO TO WAREHOUSE']; notOffload= [SELECT COUNT() FROM Container__c WHERE Provenance__c ='FFP FLORIDA' AND Shipment_Status__c ='D - AT WAREHOUSE(NOT OFFLOAD)']; offload = [SELECT COUNT() FROM Container__c WHERE Provenance__c ='FFP FLORIDA' AND Shipment_Status__c ='E - AT WAREHOUSE(OFFLOAD)']; departed = [SELECT COUNT() FROM Container__c WHERE ( Date_Return_to_wharf__c =LAST_N_DAYS:5 AND Provenance__c ='FFP FLORIDA' AND Shipment_Status__c='F - RETURNED TO WHARF')]; ContainerAtWharf = waitintingForClearance + readyToGoWarehouse; ContainerAtWarehouse = offload + notOffload; TotalContainer =ContainerAtWharf + departed + AwaitingArrival + ContainerAtWarehouse; Records = new Map<String, List<Container__c>>(); Container__c [] results = [SELECT Shipment_Status__c , Shipper__r.Name , Pkl__c, PO__c, Invoice__c,Name, Size_in_feet__c, Description__c, Bill_of_Lading__c,On_Wharf_Date__c,Sailing__c,ETA__c,Demurrage_begins__c,Brocker__c,Comments__c, ID_Container__c, Consignee__c, Provenance__c FROM Container__c WHERE (Provenance__c ='FFP FLORIDA' AND Shipment_Status__c !='F - RETURNED TO WHARF')]; lstDepartedLast5Days = [SELECT Shipment_Status__c , Date_Return_to_wharf__c, Shipper__r.Name , Pkl__c, PO__c, Invoice__c,Name, Size_in_feet__c, Description__c, Bill_of_Lading__c,On_Wharf_Date__c,Sailing__c,ETA__c,Demurrage_begins__c,Brocker__c,Comments__c, ID_Container__c, Consignee__c, Provenance__c FROM Container__c WHERE ( Date_Return_to_wharf__c =LAST_N_DAYS:5 AND Provenance__c ='FFP FLORIDA' AND Shipment_Status__c='F - RETURNED TO WHARF')]; for(Container__c result: results) { String status = result.Shipment_Status__c ; if(!Records.containsKey(status)) { Records.put(status, new Container__c[0]); } Records.get(status).add(result); } } //Chart public List<PieWedgeData> getPieData() { List<PieWedgeData> data = new List<PieWedgeData>(); data.add(new PieWedgeData('Containers In Transit', AwaitingArrival)); data.add(new PieWedgeData('Containers at Wharf', ContainerAtWharf)); data.add(new PieWedgeData('Containers at Warehouse : 1', ContainerAtWarehouse)); data.add(new PieWedgeData('Containers Returned to wharf last 5 Days', departed)); return data; } // Wrapper class public class PieWedgeData { public String name { get; set; } public Integer data { get; set; } public PieWedgeData(String name, Integer data) { this.name = name; this.data = data; } } }