public TableData(List <List <double> > predictions, Data data) { var format = new NumberFormatInfo { NumberDecimalSeparator = ".", NumberDecimalDigits = 2 }; ColumnHeaders.Add("prediction"); ColumnHeaders.Add("class"); for (var i = 1; i <= data.Attributes.First().Count; i++) { ColumnHeaders.Add("attribute " + i); } for (var i = 0; i < data.Attributes.Count; i++) { var p = new List <double>(new[] { predictions[i][0], data.ObjectClass[i] }); var row = new TableDataRow(p.Concat(data.Attributes[i]) .Select(d => d.ToString("N", format)).ToList()); Rows.Add(row); } }
private void SetUpColumnHeaders() { TableTitle = string.Format("Name{0}", SortByTitle ? SortDescending ? DownArrowLeftAligned : UpArrowLeftAligned : ""); ColumnHeaders.Clear(); HeaderHints.Clear(); switch (MaterialType) { case MaterialType.Metal: ColumnHeaders.Add(GetSortedLabel(0, Phi)); HeaderHints.Add("Work Function (eV)"); break; case MaterialType.Dielectric: ColumnHeaders.Add(GetSortedLabel(0, Kappa)); HeaderHints.Add("Dielectric Constant"); ColumnHeaders.Add(GetSortedLabel(1, "Eg")); HeaderHints.Add("Band Gap (eV)"); ColumnHeaders.Add(GetSortedLabel(2, Phi)); HeaderHints.Add("Electron Affinity (eV)"); break; case MaterialType.Semiconductor: ColumnHeaders.Add(GetSortedLabel(0, Kappa)); HeaderHints.Add("Dielectric Constant"); ColumnHeaders.Add(GetSortedLabel(1, "Eg")); HeaderHints.Add("Band Gap (eV)"); ColumnHeaders.Add(GetSortedLabel(2, Phi)); HeaderHints.Add("Electron Affinity (eV)"); ColumnHeaders.Add(GetSortedLabel(3, "ni")); HeaderHints.Add("Intrinsic Carrier Concentration (cm\u207a\u00b2)"); break; } }
public void AddNewColumn(String headerName, String value) { if (ColumnHeaders.Contains(headerName) == false) { ColumnHeaders.Add(headerName); foreach (CsvRow row in Rows) { CsvColumn csvColumn = new CsvColumn(headerName, value); row.AddColumn(headerName, value); } } }
public void RecreateContent() { LogicalChildren.Clear(); VisualChildren.Clear(); GridBorderLines.Clear(); for (int i = 0; i < 4; i++) { var line = new Line() { Stroke = GridControl.BorderBrush, StrokeThickness = GridControl.BorderThickness }; GridBorderLines.Add(line); LogicalChildren.Add(line); VisualChildren.Add(line); } ColumnHeaders.Clear(); ColumnHeaderLines.Clear(); for (int i = 0; i < GridControl.Columns.Count; i++) { GridControl.Columns[i].Index = i; var columnHeader = GridControl.Columns[i].CreateColumnHeader(); ColumnHeaders.Add(columnHeader); LogicalChildren.Add(columnHeader); VisualChildren.Add(columnHeader); var line = new Line() { Stroke = GridControl.VerticalLinesBrush, StrokeThickness = GridControl.VerticalLinesThickness }; ColumnHeaderLines.Add(line); LogicalChildren.Add(line); VisualChildren.Add(line); } HorizontalHeaderLine = new Line() { Stroke = GridControl.HorizontalLinesBrush, StrokeThickness = GridControl.HorizontalLinesThickness }; LogicalChildren.Add(HorizontalHeaderLine); VisualChildren.Add(HorizontalHeaderLine); CellsPanel.RecreateCells(); LogicalChildren.Add(CellsPanel); VisualChildren.Add(CellsPanel); }
public ITable <TItem> WithExplicitColumn(string name, params Expression <Func <TItem, bool> >[] selectors) { ColumnHeaders.Add(CreateExplicitAxis(name, selectors)); return(this); }
public ITable <TItem> WithColumns <TKey>(string name, Func <TItem, TKey> selector) { ColumnHeaders.Add(CreateIdenttiyAxis(name, selector)); return(this); }