コード例 #1
0
        public void RefreshTableViz(Visual visual)
        {
            DataTable table         = GetTableFromParameter("statResult");
            string    testPerformed = "";

            if (table != null)
            {
                visual.As <TablePlot>().Data.DataTableReference = table;
                TablePlot            tablePlot  = visual.As <TablePlot>();
                DataColumnCollection dfColumns  = visual.As <TablePlot>().Data.DataTableReference.Columns;
                List <DataColumn>    listOfCols = new List <DataColumn>();
                DataValueCursor      dv         = DataValueCursor.CreateFormatted(table.Columns["test"]);
                foreach (DataRow row in table.GetRows(dv))
                {
                    testPerformed = dv.CurrentDataValue.ValidValue.ToString();
                    break;
                }

                for (int i = 0; i < dfColumns.Count(); i++)
                {
                    if (!(dfColumns[i].Name == "W" && testPerformed == "t test") && !(dfColumns[i].Name == "t" && testPerformed == "Mann-Withney test") && !(dfColumns[i].Name == "degree_of_freedom" && testPerformed == "Mann-Withney test"))
                    {
                        listOfCols.Add(dfColumns[i]);
                    }
                }
                visual.As <TablePlot>().TableColumns.Clear();
                visual.As <TablePlot>().TableColumns.AddRange(listOfCols);
            }
        }