Esempio n. 1
0
        private void LoadData(object sender, RoutedEventArgs e)
        {
            string path = "";

            OpenFileDialog openFileDialog = new OpenFileDialog();

            if (openFileDialog.ShowDialog() == true)
            {
                path        = openFileDialog.FileName;
                _fileLoader = new FileLoader(path, ',');
                _csv        = _fileLoader.GetCsv();

                OverUnderSample.DataModificator modificator = new OverUnderSample.DataModificator();
                modificator.ProcessData(_csv);

                SeriesCollection.Clear();

                foreach (var info in modificator.ClassInfo)
                {
                    SeriesCollection.Add(new PieSeries()
                    {
                        Title  = info.Key,
                        Values = new ChartValues <double> {
                            info.Value
                        },
                        DataLabels = true
                    });
                }
                PieChart.Visibility       = Visibility.Visible;
                OverSampleBox.Visibility  = Visibility.Visible;
                UnderSampleBox.Visibility = Visibility.Visible;
            }
        }
Esempio n. 2
0
        private void SaveToDat(object sender, RoutedEventArgs e)
        {
            OverUnderSample.DataModificator modificator = new OverUnderSample.DataModificator();
            var stringList = modificator.ToStringList(_csv, ',');


            SaveFileDialog saveFileDialog = new SaveFileDialog();

            if (saveFileDialog.ShowDialog() == true)
            {
                _fileLoader.SaveToDat(stringList, saveFileDialog.FileName);
            }
        }
Esempio n. 3
0
        private void OverSample(object sender, RoutedEventArgs e)
        {
            OverUnderSample.DataModificator modificator = new OverUnderSample.DataModificator();
            modificator.RadomOverSample(_csv);
            modificator.ProcessData(_csv);

            SeriesCollection.Clear();

            foreach (var info in modificator.ClassInfo)
            {
                SeriesCollection.Add(new PieSeries()
                {
                    Title  = info.Key,
                    Values = new ChartValues <double> {
                        info.Value
                    },
                    DataLabels = true
                });
            }

            SaveToDatBox.Visibility = Visibility.Visible;
        }