private PCData[] GetPCData(string[][] rows) { List <PCData> pcdataList = new List <PCData>(); var counters = rows.Select(a => new { deployment = a[2], roleinstance = a[3], countername = a[4] }).Distinct(); foreach (var counter in counters) { PCData data = new PCData { Deployment = counter.deployment, RoleInstance = counter.roleinstance, CounterName = counter.countername }; data.Points = rows.Where(a => a[2] == data.Deployment && a[3] == data.RoleInstance && a[4] == data.CounterName).Select(a => new PCPoint { X = a[1], Y = ConvertToDouble(a[5]) }).OrderBy(p => p.X).ToArray(); pcdataList.Add(data); } return(pcdataList.OrderBy(p => p.CounterName).ThenBy(p => p.Deployment).ThenBy(p => p.RoleInstance).ToArray()); }
private Series[] GetSeries(PCData[] counters) { List<Series> seriesList = new List<Series>(); // Distinct list of counters foreach (var counter in counters) { Series series = new Series(counter.ToString()); series.ChartType = SeriesChartType.Line; foreach (var point in counter.ScaledPoints) series.Points.AddXY(point.X, point.Y); series.Color = counter.Color; series.BorderWidth = 3; seriesList.Add(series); } return seriesList.ToArray(); }
private PCData[] GetPCData(string[][] rows) { List<PCData> pcdataList = new List<PCData>(); var counters = rows.Select(a => new { deployment = a[2], roleinstance = a[3], countername = a[4] }).Distinct(); foreach (var counter in counters) { PCData data = new PCData { Deployment = counter.deployment, RoleInstance = counter.roleinstance, CounterName = counter.countername }; data.Points = rows.Where(a => a[2] == data.Deployment && a[3] == data.RoleInstance && a[4] == data.CounterName).Select(a => new PCPoint { X = a[1], Y = ConvertToDouble(a[5]) }).OrderBy(p => p.X).ToArray(); pcdataList.Add(data); } return pcdataList.OrderBy(p => p.CounterName).ThenBy(p => p.Deployment).ThenBy(p => p.RoleInstance).ToArray(); }