private void initComboBoxes()
        {
            voivodeshipComboBox.Items.Add("Polska");
            sportComboBox.Items.Add("Wszystkie");

            for (int i = 0; i < dataHolder.VoivodeshipCount; i++)
            {
                voivodeshipComboBox.Items.Add(VoivodeshipNamesExtensions.GetName((VoivodeshipNames)i));
            }

            for (int i = 0; i < dataHolder.SportCount; i++)
            {
                sportComboBox.Items.Add(dataHolder.SportNames[i]);
            }

            propertyComboBox.Items.Add("Sekcji");
            propertyComboBox.Items.Add("Ogółem");
            propertyComboBox.Items.Add("Kobiet");
            propertyComboBox.Items.Add("Juniorów");
            propertyComboBox.Items.Add("Juniorek");

            voivodeshipComboBox.SelectedIndex     = 0;
            voivodeshipComboBox.SelectionChanged += comboBox_SelectionChanged;

            sportComboBox.SelectedIndex     = 0;
            sportComboBox.SelectionChanged += comboBox_SelectionChanged;

            propertyComboBox.SelectedIndex     = 0;
            propertyComboBox.SelectionChanged += comboBox_SelectionChanged;
        }
        public void Init()
        {
            areaNameLabel.Content = VoivodeshipNamesExtensions.GetName(voivodeshipName);

            PieChart pieChart = new PieChart(chartPosition, chartSize);

            pieChart.Create(mapPainter.GetAreaChartValues((int)voivodeshipName));

            StatisticsData[] statisticsData = mapPainter.Holder.VoivodeshipData[(int)voivodeshipName];
            StatisticsData   minData        = mapPainter.Holder.GetMinDatasInVoivodeship(voivodeshipName);
            StatisticsData   maxData        = mapPainter.Holder.GetMaxDatasInVoivodeship(voivodeshipName);

            faces = ChernoffFace.GetFaces(pieChart, statisticsData, minData, maxData);

            pieChart.Draw(chartCanvas);
            chartCanvas.Background = Brushes.Azure;

            foreach (ChernoffFace face in faces)
            {
                face.Draw(chartCanvas);
            }

            // ChernoffFace.AdjustView(faces, chartCanvas, chartCanvasScaleTransform, chartCanvasTranslateTransform);

            foreach (string sportName in mapPainter.Holder.SportNames)
            {
                sportNameCb.Items.Add(sportName);
            }

            if (sportNameCb.Items.Count > 0)
            {
                sportNameCb.SelectedIndex = 0;
            }
        }
Example #3
0
        private void drawPreview(int areaIndex)
        {
            VoivodeshipNames areaName = (VoivodeshipNames)areaIndex;

            prevLabel.Content = VoivodeshipNamesExtensions.GetName(areaName);

            Point chartPosition = new Point(previewCanvas.Width / 2, previewCanvas.Height / 2);
            int   chartSize     = (int)(previewCanvas.Width / 4);

            PieChart pieChart = new PieChart(chartPosition, chartSize);

            pieChart.Create(mapPainter.GetAreaChartValues(areaIndex));

            StatisticsData[] statisticsData = mapPainter.Holder.VoivodeshipData[areaIndex];
            StatisticsData   minData        = mapPainter.Holder.GetMinDatasInVoivodeship(areaName);
            StatisticsData   maxData        = mapPainter.Holder.GetMaxDatasInVoivodeship(areaName);

            ChernoffFace[] faces = ChernoffFace.GetFaces(pieChart, statisticsData, minData, maxData);

            previewCanvas.Children.Clear();

            pieChart.Draw(previewCanvas);

            foreach (ChernoffFace face in faces)
            {
                face.Draw(previewCanvas);
            }
        }
        private void initComboBoxes()
        {
            voivodeshipComboBox.Items.Add("Wszystkie");
            sportComboBox.Items.Add("Wszystkie");

            for (int i = 0; i < dataHolder.VoivodeshipCount; i++)
            {
                voivodeshipComboBox.Items.Add(VoivodeshipNamesExtensions.GetName((VoivodeshipNames)i));
            }

            for (int i = 0; i < dataHolder.SportCount; i++)
            {
                sportComboBox.Items.Add(dataHolder.SportNames[i]);
            }

            for (int i = 0; i < axisValues.Length; i++)
            {
                axisXComboBox.Items.Add(axisValues[i]);
                axisYComboBox.Items.Add(axisValues[i]);
            }

            voivodeshipComboBox.SelectedIndex = 0;
            sportComboBox.SelectedIndex       = 0;
            axisXComboBox.SelectedIndex       = 0;
            axisYComboBox.SelectedIndex       = 0;

            voivodeshipComboBox.SelectionChanged += comboBox_SelectionChanged;
            sportComboBox.SelectionChanged       += comboBox_SelectionChanged;
            axisXComboBox.SelectionChanged       += comboBox_SelectionChanged;
            axisYComboBox.SelectionChanged       += comboBox_SelectionChanged;
        }
Example #5
0
        private void initTreeViewData()
        {
            dataTreeView.Items.Clear();

            for (int i = 0; i < dataHolder.VoivodeshipCount; i++)
            {
                TreeViewItem item = new TreeViewItem()
                {
                    Header = VoivodeshipNamesExtensions.GetName((VoivodeshipNames)i)
                };

                for (int j = 0; j < dataHolder.SportCount; j++)
                {
                    TreeViewItem sportItem = new TreeViewItem()
                    {
                        Header = dataHolder.SportNames[j]
                    };

                    sportItem.Items.Add(new TreeViewItem()
                    {
                        Header = "Sekcji: " + dataHolder.VoivodeshipData[i][j].Sections
                    });

                    sportItem.Items.Add(new TreeViewItem()
                    {
                        Header = "Ogółem: " + dataHolder.VoivodeshipData[i][j].Total
                    });

                    sportItem.Items.Add(new TreeViewItem()
                    {
                        Header = "Kobiet: " + dataHolder.VoivodeshipData[i][j].Womens
                    });

                    sportItem.Items.Add(new TreeViewItem()
                    {
                        Header = "Juniorów: " + dataHolder.VoivodeshipData[i][j].Boys
                    });

                    sportItem.Items.Add(new TreeViewItem()
                    {
                        Header = "Juniorek: " + dataHolder.VoivodeshipData[i][j].Girls
                    });

                    item.Items.Add(sportItem);
                }

                dataTreeView.Items.Add(item);
            }
        }