public static WebCharting.Data.SeriesDataPoints DoublesToDataPoints(double[] values_raw) { var datapoints = new WebCharting.Data.SeriesDataPoints(); foreach (var val in values_raw) { var ts = string.Format("{0}", val.ToString()); var hl = string.Format("http://www.microsoft.com/{0}", val.ToString()); var label = val.ToString(); var p = new WebCharting.Data.DataPoint(val, hl, ts); p.Label = label; datapoints.Add(p); } return(datapoints); }
public static WebCharting.Data.DataSetSingleSeries GetSingleSeries2() { var types = typeof(System.String).Assembly.GetExportedTypes() .Where(t => t.IsClass) .Where(t => t.IsPublic); var data = types.Select( t => new { typename = t.Name, typefullname = t.FullName, nummethods = t.GetMethods().Length, numprops = t.GetProperties().Length }); int topn = 5; var final_data = (from p in data orderby p.nummethods descending select p).Take(topn).ToList(); var datapoints = new WebCharting.Data.SeriesDataPoints(); var labels = new WebCharting.Data.AxisLabels(); for (int i = 0; i < final_data.Count; i++) { var datum = final_data[i]; string dp_hlink = string.Format("http://msdn.microsoft.com/en-us/library/{0}.aspx", datum.typefullname); var dp_label = datum.nummethods.ToString(); var dp_value = datum.nummethods; var dp = new WebCharting.Data.DataPoint(dp_value, dp_hlink, dp_label); dp.Label = datum.nummethods.ToString(); datapoints.Add(dp); labels.Add(datum.typename); } var chartdata = new WebCharting.Data.DataSetSingleSeries(datapoints, labels); return(chartdata); }
public static WebCharting.Data.SeriesDataPoints DoublesToDataPoints(double[] values_raw) { var datapoints = new WebCharting.Data.SeriesDataPoints(); foreach (var val in values_raw) { var ts = string.Format("{0}", val.ToString()); var hl = string.Format("http://www.microsoft.com/{0}", val.ToString()); var label = val.ToString(); var p = new WebCharting.Data.DataPoint(val, hl, ts); p.Label = label; datapoints.Add(p); } return datapoints; }
public static WebCharting.Data.DataSetSingleSeries GetSingleSeries2() { var types = typeof (System.String).Assembly.GetExportedTypes() .Where(t => t.IsClass) .Where(t => t.IsPublic); var data = types.Select( t => new { typename = t.Name, typefullname = t.FullName, nummethods = t.GetMethods().Length, numprops = t.GetProperties().Length }); int topn = 5; var final_data = (from p in data orderby p.nummethods descending select p).Take(topn).ToList(); var datapoints = new WebCharting.Data.SeriesDataPoints(); var labels = new WebCharting.Data.AxisLabels(); for (int i = 0; i < final_data.Count; i++) { var datum = final_data[i]; string dp_hlink = string.Format("http://msdn.microsoft.com/en-us/library/{0}.aspx", datum.typefullname); var dp_label = datum.nummethods.ToString(); var dp_value = datum.nummethods; var dp = new WebCharting.Data.DataPoint(dp_value, dp_hlink, dp_label); dp.Label = datum.nummethods.ToString(); datapoints.Add(dp); labels.Add(datum.typename); } var chartdata = new WebCharting.Data.DataSetSingleSeries(datapoints, labels); return chartdata; }