private void showGraphicsButton_Click(object sender, EventArgs e) { switch (cbGraphKind.SelectedIndex) { case 0: { if (variationSeries != null) { DisplayForm.DisplayStatFreq(variationSeries.SeriesTable); LoggerEvs.writeLog("Построение полигона..."); } break; } case 1: { if (intervalSeries != null) { DisplayForm.DisplayIntervalFreq(intervalSeries.SeriesTable); LoggerEvs.writeLog("Построение гистограммы..."); } break; } case 2: { if (intervalSeries != null) { EmpiricFunction.ShowEmpiricFunction(relativeSeries.SeriesTable); LoggerEvs.writeLog("Построение функции распределения..."); } break; } } }
private void showGraphicsButton_Click(object sender, EventArgs e) { switch (cbGraphKind.SelectedIndex) { case 0: { if (groupedSeries != null) { SortedDictionary <double, int> modifiedSeries = new SortedDictionary <double, int>(); double summ = groupedSeries.ElementsCount; foreach (var pair in groupedSeries.SeriesTable) { modifiedSeries.Add(pair.Key, (int)(pair.Value * summ)); } DisplayForm.DisplayStatFreq(modifiedSeries); LoggerEvs.writeLog("Построение полигона..."); } break; } case 1: { if (intSeries != null) { DisplayForm.DisplayIntervalFreq(intSeries.SeriesTable); LoggerEvs.writeLog("Построение гистограммы..."); } break; } case 2: { if (groupedSeries != null) { SortedDictionary <double, double> modifiedSeries = new SortedDictionary <double, double>(); double summ = 0; foreach (var pair in groupedSeries.SeriesTable) { summ += pair.Value; } foreach (var pair in groupedSeries.SeriesTable) { modifiedSeries.Add(pair.Key, pair.Value / summ); } EmpiricFunction.ShowEmpiricFunction(modifiedSeries); LoggerEvs.writeLog("Построение функции распределения..."); } break; } } }
// Построение графиков #region ShowGraphics private void showGraphicsButton_Click(object sender, EventArgs e) { switch (cbGraphKind.SelectedIndex) { case 0: { if (groupedSeries != null) { SortedDictionary <double, int> modifiedSeries = new SortedDictionary <double, int>(); double summ = groupedSeries.ElementsCount; foreach (var pair in groupedSeries.SeriesTable) { modifiedSeries.Add(pair.Key, (int)(pair.Value * summ)); } DisplayForm.DisplayStatFreq(modifiedSeries); LoggerEvs.writeLog("Построение полигона..."); } break; } case 1: { if (intSeries != null) { DisplayForm.DisplayIntervalFreq(intSeries.SeriesTable); LoggerEvs.writeLog("Построение гистограммы..."); } break; } case 2: { if (groupedSeries != null) { SortedDictionary <double, double> modifiedSeries = new SortedDictionary <double, double>(); double summ = 0; foreach (var pair in groupedSeries.SeriesTable) { summ += pair.Value; } foreach (var pair in groupedSeries.SeriesTable) { modifiedSeries.Add(pair.Key, pair.Value / summ); } EmpiricFunction.ShowEmpiricFunction(modifiedSeries); LoggerEvs.writeLog("Построение функции распределения..."); } break; } case 3: { if (groupedSeries != null) { CheckDistributionForm wnd = new CheckDistributionForm(); double sampleMeanSquare = SeriesCharacteristics.calculateSampleMeanSquareNew(groupedSeries.SeriesTable); double sampleMean = SeriesCharacteristics.calculateSampleMean(groupedSeries.SeriesTable); double dispersion = SeriesCharacteristics.calculateDispersion(groupedSeries.SeriesTable); wnd.draw_distribution(groupedSeries.SeriesTable, "Выборка", sampleMean, sampleMeanSquare, Color.FromArgb(255, 255, 0, 255)); wnd.drawNormalDistribution(dispersion, sampleMeanSquare, sampleMean); wnd.Show(); } break; } case 4: { if (groupedSeries != null) { CheckDistributionForm wnd = new CheckDistributionForm(); double sampleMeanSquare = SeriesCharacteristics.calculateSampleMeanSquareNew(groupedSeries.SeriesTable); double sampleMean = SeriesCharacteristics.calculateSampleMean(groupedSeries.SeriesTable); double dispersion = SeriesCharacteristics.calculateDispersion(groupedSeries.SeriesTable); wnd.draw_distribution(groupedSeries.SeriesTable, "Выборка", sampleMean, sampleMeanSquare, Color.FromArgb(255, 255, 0, 255)); wnd.drawExpDistribution(dispersion, sampleMeanSquare, sampleMean); wnd.Show(); } break; } } }