Exemple #1
0
        public DataRow CreateSelectedDataRow(string variableName, DataRowVisualProperties.DataRowChartType chartType)
        {
            IDictionary <int, IList <int> > selection = PreprocessingData.Selection;
            int variableIndex = PreprocessingData.GetColumnIndex(variableName);

            if (selection.Keys.Contains(variableIndex))
            {
                List <int> selectedIndices = new List <int>(selection[variableIndex]);
                //need selection with more than 1 value
                if (selectedIndices.Count < 2)
                {
                    return(null);
                }

                selectedIndices.Sort();
                int start = selectedIndices[0];
                int end   = selectedIndices[selectedIndices.Count - 1];

                DataRow rowSelect = CreateDataRowRange(variableName, start, end, chartType);
                return(rowSelect);
            }
            else
            {
                return(null);
            }
        }
Exemple #2
0
        public DataRow CreateDataRow(string variableName, DataRowVisualProperties.DataRowChartType chartType)
        {
            IList <double> values = PreprocessingData.GetValues <double>(PreprocessingData.GetColumnIndex(variableName));
            DataRow        row    = new DataRow(variableName, "", values);

            row.VisualProperties.ChartType = chartType;
            return(row);
        }
Exemple #3
0
        public List <DataRow> CreateAllDataRows(DataRowVisualProperties.DataRowChartType chartType)
        {
            List <DataRow> dataRows = new List <DataRow>();

            foreach (var name in PreprocessingData.GetDoubleVariableNames())
            {
                dataRows.Add(CreateDataRow(name, chartType));
            }
            return(dataRows);
        }
Exemple #4
0
        public List <DataRow> CreateAllSelectedDataRows(DataRowVisualProperties.DataRowChartType chartType)
        {
            List <DataRow> dataRows = new List <DataRow>();

            foreach (var name in PreprocessingData.GetDoubleVariableNames())
            {
                DataRow row = CreateSelectedDataRow(name, chartType);
                if (row != null)
                {
                    dataRows.Add(row);
                }
            }
            return(dataRows);
        }
Exemple #5
0
 private void chartTypeComboBox_SelectedValueChanged(object sender, EventArgs e)
 {
     if (!SuppressEvents && Content != null)
     {
         DataRowVisualProperties.DataRowChartType selected = (DataRowVisualProperties.DataRowChartType)chartTypeComboBox.SelectedValue;
         Content.ChartType = selected;
         if (Content.ChartType != selected)
         {
             MessageBox.Show("There may be incompatibilities with other series or the data is not suited to be displayed as " + selected.ToString() + ".", "Failed to set type to " + selected.ToString());
             SuppressEvents = true;
             try {
                 chartTypeComboBox.SelectedItem = Content.ChartType;
             } finally { SuppressEvents = false; }
         }
         SetEnabledStateOfControls();
     }
 }
Exemple #6
0
        public DataRow CreateDataRowRange(string variableName, int start, int end, DataRowVisualProperties.DataRowChartType chartType)
        {
            IList <double> values      = PreprocessingData.GetValues <double>(PreprocessingData.GetColumnIndex(variableName));
            IList <double> valuesRange = new List <double>();

            for (int i = 0; i < values.Count; i++)
            {
                if (i >= start && i <= end)
                {
                    valuesRange.Add(values[i]);
                }
                else
                {
                    valuesRange.Add(Double.NaN);
                }
            }

            DataRow row = new DataRow(variableName, "", valuesRange);

            row.VisualProperties.ChartType = chartType;
            return(row);
        }
        public static DataRow CreateDataRow(IFilteredPreprocessingData preprocessingData, string variableName, DataRowVisualProperties.DataRowChartType chartType)
        {
            var values = preprocessingData.GetValues <double>(preprocessingData.GetColumnIndex(variableName));
            var row    = new DataRow(variableName, "", values)
            {
                VisualProperties =
                {
                    ChartType      = chartType,
                    StartIndexZero = true
                }
            };

            return(row);
        }
 public DataRow CreateDataRow(string variableName, DataRowVisualProperties.DataRowChartType chartType)
 {
     return(CreateDataRow(PreprocessingData, variableName, chartType));
 }
 public PreprocessingChartView() {
   InitializeComponent();
   chartType = DataRowVisualProperties.DataRowChartType.Line;
   chartTitle = DEFAULT_CHART_TITLE;
 }
 public PreprocessingChartView()
 {
     InitializeComponent();
     chartType  = DataRowVisualProperties.DataRowChartType.Line;
     chartTitle = DEFAULT_CHART_TITLE;
 }