public string GetDataDiagram() { List <DateTime> createdTasks = data.GetTaskCrearedDates(WebSecurity.GetUserId(User.Identity.Name)); DiagramModel diagram = new DiagramModel { name = "Users task activity", data = new List <List <object> >() }; int coordinateX = 0; foreach (var createdTask in createdTasks) { List <object> temp = new List <object>(); temp.Add(new TimeSpan(createdTask.ToLocalTime().ToUniversalTime().Ticks).TotalMilliseconds); temp.Add(coordinateX++); diagram.data.Add(temp); } return(JsonConvert.SerializeObject(new List <object> { diagram })); }