Пример #1
0
        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);
                    }
                }
            }
        }
Пример #2
0
        //Open scatter plot in new tab with new content when double clicked
        private void ScatterPlotDoubleClick(object sender, EventArgs e)
        {
            PreprocessingScatterPlotView pspv           = (PreprocessingScatterPlotView)sender;
            ScatterPlotContent           scatterContent = new ScatterPlotContent(Content, new Cloner()); // create new content
            ScatterPlot scatterPlot = pspv.Content;

            setVariablesInContentFromScatterPlot(scatterContent, scatterPlot);

            MainFormManager.MainForm.ShowContent(scatterContent, typeof(ScatterPlotSingleView)); // open in new tab
        }
    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);
          }
        }
      }
    }