public Graph.Graph TeamPositionInTIme() { Graph.Graph graph = new Graph.Graph(); graph.GraphName = "Team position"; IEnumerable<V_TeamPositionInTime> positionInTime = _graphDataRepository.TeamPosition(); foreach (var row in positionInTime) { DateTime date = row.MatchDate; string teamName = row.TeamName; string position = row.Position.ToString(); if (!graph.Points.ContainsKey(teamName)) graph.Points[teamName] = new List<Point>(); Point p = new Point(); p.x = date; p.y = position; graph.Points[teamName].Add(p); } return graph; }
public Graph.Graph TeamPointsInTime() { Graph.Graph graph = new Graph.Graph(); graph.GraphName = "Team score"; IEnumerable<V_TeamPointsInTime> pointsInTime = _graphDataRepository.TeamPoints().OrderBy(m => m.MatchDate); foreach (V_TeamPointsInTime row in pointsInTime) { DateTime date = row.MatchDate; string teamName = row.TeamName; string score = row.Points.ToString(); if (!graph.Points.ContainsKey(teamName)) graph.Points[teamName] = new List<Point>(); Point p = new Point(); p.x = date; p.y = score; graph.Points[teamName].Add(p); } return graph; }