I need to plot values vs week. I don't see any errors. But just the data is not populated ?
public class ChartController {
// Return a list of data points for a chart
public List<Data> getData() {
return ChartController.getChartData();
}
// Make the chart data available via JavaScript remoting
@RemoteAction
public static List<Data> getRemoteData() {
return ChartController.getChartData();
}
// The actual chart data; needs to be static to be
// called by a @RemoteAction method
public static List<Data> getChartData() {
List<Data> data = new List<Data>();
List<Onboard_Forecast__c> ofList = [SELECT Actual__c,Week__c,Planned__c,Forecast__c FROM Forecast__c ];
for(Forecast__c of1:ofList){
data.add(new Data(string.valueof(of1.Week__c),integer.valueof(of1.Actual__c),integer.valueof(of1.Forecast__c),integer.valueof(of1.Planned__c)));
}
return data;
}
// Wrapper class
public class Data {
public String name { get; set; }
public Integer data1 { get; set; }
public Integer data2 { get; set; }
public Integer data3 { get; set; }
public Data(String name, Integer data1, Integer data2, Integer data3) {
this.name = name;
this.data1 = data1;
this.data2 = data2;
this.data3 = data3;
system.debug('week '+this.name);
}
}
}