Example
List data = FindShareOfGrowth(lstCountries, new DateTime(2009,10,5))
this needs to have a customized sorting
like
data.ChartSort()
public ListFindShareOfGrowth(List lstCountry, DateTime minDate)
{
var db = new ValueUpDBDataContext();
var queryNN = FindAllNNHelper(db, lstCountry, minDate);
var queryAll = FindAllMinMaxNNHelper(db, chartNr, lstCountry, minDate);
queryAll.ToList();
var query = from nn in queryNN
join all in queryAll on new { K1 = nn.DateRange, K2 = nn.Name }
equals new { K1 = all.DateRange, K2 = all.Name }
select new ChartData
{
Name = nn.Name,
DateRange = nn.DateRange,
Value = nn.Value / all.ValueAbs,
Volume = nn.Volume / all.VolumeAbs
};
return query.OrderBy(c => c.DateRange).ThenBy(c => c.Name).ToList();
}
No comments:
Post a Comment