public void GetClustersByDistance(double clusterDistance) { ClusterSet clustersByDistance = this.bestClusterAnalysis.CutTree(clusterDistance); ConsoleWriter.WriteClusterCountries(countryStatistics, clustersByDistance); ChartCreator.CreateChart(countryStatistics, clustersByDistance, "clustersByDistance"); }
public void GetClustersByAmount(int clusterCount) { ClusterSet clustersByAmount = this.bestClusterAnalysis.CutTree(clusterCount); ConsoleWriter.WriteClusterCountries(countryStatistics, clustersByAmount); ChartCreator.CreateChart(countryStatistics, clustersByAmount, "clustersByAmount"); }
public static void CreateChart(CountryStatistics[] countryStatistics, string name) { var chartCreator = new ChartCreator("Sugar", "Death", name); foreach (var countryStat in countryStatistics) { chartCreator.AddPoint(countryStat.SugarConsumption, countryStat.DeathLevel, countryStat.Country); } chartCreator.SaveAsFile(); }
public static void CreateChart(CountryStatistics[] countryStatistics, string name) { ConsoleWriter.WriteSystemMessage("Drawing the diagram for displaying normalized data..."); var chartCreator = new ChartCreator("Alcohol", "Fruit", name); foreach (var countryStat in countryStatistics) { chartCreator.AddPoint(countryStat.AlcoholConsumption, countryStat.FruitConsumption, countryStat.Country); } chartCreator.SaveAsFile(); ConsoleWriter.WriteSystemMessage("Saved on the app resources directory as 'chart.png'."); }
public static void CreateChart(CountryStatistics[] countryStatistics, ClusterSet clusters, string name) { ConsoleWriter.WriteSystemMessage("Drawing diagrams for displaying cluster data..."); var chartCreator = new ChartCreator("Alcohol", "Fruit", name); for (int i = 0; i < clusters.NumberOfClusters; i++) { var clusterCountryStatistics = clusters.Cluster(i).Select(x => countryStatistics[x]); foreach (var countryStat in clusterCountryStatistics) { chartCreator.AddPoint(countryStat.AlcoholConsumption, countryStat.FruitConsumption, countryStat.Country, i); } } chartCreator.SaveAsFile(); ConsoleWriter.WriteSystemMessage($"Saved at the app resources directory as '{name}.png'."); }