public static string GetDayReport(DateTime start, DateTime end) { var res = new List <DataPoint>(); var list = reportDAO.GetDayReport(start, end).ToList(); int index = 0; for (DateTime i = start; i <= end; i = i.AddDays(1)) { if (index < list.Count && DateEquals(i, list[index].date)) { res.Add(new DataPoint(list[index++].Total, i.ToString("dd MMM"))); } else { res.Add(new DataPoint(0, i.ToString("dd MMM"))); } } return(JsonConvert.SerializeObject(res, jsonSetting)); }