예제 #1
0
        public void GetClustersByDistance(double clusterDistance)
        {
            ClusterSet clustersByDistance = this.bestClusterAnalysis.CutTree(clusterDistance);

            ConsoleWriter.WriteClusterCountries(countryStatistics, clustersByDistance);
            ChartCreator.CreateChart(countryStatistics, clustersByDistance, "clustersByDistance");
        }
예제 #2
0
        public void GetClustersByAmount(int clusterCount)
        {
            ClusterSet clustersByAmount = this.bestClusterAnalysis.CutTree(clusterCount);

            ConsoleWriter.WriteClusterCountries(countryStatistics, clustersByAmount);
            ChartCreator.CreateChart(countryStatistics, clustersByAmount, "clustersByAmount");
        }
예제 #3
0
        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();
        }
예제 #4
0
        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'.");
        }
예제 #5
0
        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'.");
        }