private void addChartsToTableLayoutPanel() { List <string> variables = Content.PreprocessingData.GetDoubleVariableNames().ToList(); //set scatter plots and histograms for (int x = 1; x < variables.Count + 1; x++) { for (int y = 1; y < variables.Count + 1; y++) { // use historgram if x and y variable are equal if (x == y) { PreprocessingDataTable dataTable = new PreprocessingDataTable(); DataRow dataRow = Content.CreateDataRow(variables[x - 1], DataRowVisualProperties.DataRowChartType.Histogram); dataTable.Rows.Add(dataRow); PreprocessingDataTableView pcv = new PreprocessingDataTableView(); pcv.ChartDoubleClick += HistogramDoubleClick; pcv.Content = dataTable; tableLayoutPanel.Controls.Add(pcv, y, x); } //scatter plot else { ScatterPlot scatterPlot = Content.CreateScatterPlot(variables[x - 1], variables[y - 1]); PreprocessingScatterPlotView pspv = new PreprocessingScatterPlotView(); pspv.ChartDoubleClick += ScatterPlotDoubleClick; pspv.Content = scatterPlot; pspv.Dock = DockStyle.Fill; tableLayoutPanel.Controls.Add(pspv, x, y); } } } }
//open histogram in new tab with new content when double clicked private void HistogramDoubleClick(object sender, EventArgs e) { PreprocessingDataTableView pcv = (PreprocessingDataTableView)sender; HistogramContent histoContent = new HistogramContent(Content.PreprocessingData); // create new content histoContent.VariableItemList = Content.CreateVariableItemList(); PreprocessingDataTable dataTable = pcv.Content; setVariableItemListFromDataTable(histoContent, dataTable); MainFormManager.MainForm.ShowContent(histoContent, typeof(HistogramView)); // open in new tab }
private void AddDataTableToTableLayout(PreprocessingDataTable dataTable, int x, int y) { PreprocessingDataTableView dataView = new PreprocessingDataTableView(); dataView.Classification = Classification; dataView.IsDetailedChartViewEnabled = IsDetailedChartViewEnabled; if (dataTable == null) { // dummy panel for empty field Panel p = new Panel(); p.Dock = DockStyle.Fill; tableLayoutPanel.Controls.Add(p, y, x); } else { dataView.Content = dataTable; dataView.Dock = DockStyle.Fill; tableLayoutPanel.Controls.Add(dataView, y, x); } }
private void AddDataTableToTableLayout(PreprocessingDataTable dataTable, int x, int y) { PreprocessingDataTableView dataView = new PreprocessingDataTableView(); dataView.Classification = Classification; dataView.IsDetailedChartViewEnabled = IsDetailedChartViewEnabled; if (dataTable == null) { // dummy panel for empty field Panel p = new Panel(); p.Dock = DockStyle.Fill; tableLayoutPanel.Controls.Add(p, y, x); } else { dataView.Content = dataTable; dataView.Dock = DockStyle.Fill; tableLayoutPanel.Controls.Add(dataView, y, x); } }
private void addChartsToTableLayoutPanel() { List<string> variables = Content.PreprocessingData.GetDoubleVariableNames().ToList(); //set scatter plots and histograms for (int x = 1; x < variables.Count + 1; x++) { for (int y = 1; y < variables.Count + 1; y++) { // use historgram if x and y variable are equal if (x == y) { PreprocessingDataTable dataTable = new PreprocessingDataTable(); DataRow dataRow = Content.CreateDataRow(variables[x - 1], DataRowVisualProperties.DataRowChartType.Histogram); dataTable.Rows.Add(dataRow); PreprocessingDataTableView pcv = new PreprocessingDataTableView(); pcv.ChartDoubleClick += HistogramDoubleClick; pcv.Content = dataTable; tableLayoutPanel.Controls.Add(pcv, y, x); } //scatter plot else { ScatterPlot scatterPlot = Content.CreateScatterPlot(variables[x - 1], variables[y - 1]); PreprocessingScatterPlotView pspv = new PreprocessingScatterPlotView(); pspv.ChartDoubleClick += ScatterPlotDoubleClick; pspv.Content = scatterPlot; pspv.Dock = DockStyle.Fill; tableLayoutPanel.Controls.Add(pspv, x, y); } } } }