private void AddMajorRow(List<string> ycats, int row, BL.Container root, List<string> xcats, int cols) { var n_row = root.AddContainer(BL.Direction.LeftToRight); n_row.ChildSpacing = CellHorizontalSeparation; // -- add indent n_row.AddBox(Indent, 0.25); foreach (int col in Enumerable.Range(0, cols)) { var n_cell = n_row.AddContainer(BL.Direction.LeftToRight); // --- n_cell.Direction = BL.Direction.LeftToRight; n_cell.ChildSpacing = CellVerticalSeparation; var items_for_cells = this.Items.Where(i => i.XCategory == xcats[col] && i.YCategory == ycats[row]); foreach (var cell_item in items_for_cells) { draw_cell(cell_item, n_cell); } } var n_row_label = root.AddBox(0.25, CategoryHeight); var info = new RenderItem(); info.CategoryCell = null; info.ShapeText = ycats[row]; info.Cells = ycatformat; info.Underline = true; n_row_label.Data = info; }
private void draw_cell(CategoryCell cell_item, BL.Container n_row_col) { var n_cell = n_row_col.AddContainer(BL.Direction.LeftToRight, CellWidth, CellHeight); n_cell.ChildSpacing = CellVerticalSeparation/2; var cell_data = new RenderItem(); cell_data.CategoryCell = cell_item; cell_data.ShapeText = cell_item.Item.Text; cell_data.Cells = cellformat; n_cell.Data = cell_data; if (cell_item.Item.Items != null) { foreach (var sub_cat_items in cell_item.Item.Items) { var subn_cell = n_cell.AddBox(CellWidth, CellHeight); var subcell_data = new RenderItem(); subcell_data.CategoryCell = null; subcell_data.ShapeText = sub_cat_items.Text; subcell_data.Cells = subcellformat; subn_cell.Data = subcell_data; } n_cell.AddBox(0.25, 0.25); } }
private void AddXCatLabels(List<string> xcats, int cols, BL.Container root) { var n_row = root.AddContainer(BL.Direction.LeftToRight); n_row.ChildSpacing = CellHorizontalSeparation; // Add indent n_row.AddBox(Indent, 0.25); // Add XCategory labels foreach (int col in Enumerable.Range(0, cols)) { var n_label = n_row.AddBox(CellWidth, 0.5); var info = new RenderItem(); info.CategoryCell = null; info.ShapeText = xcats[col]; info.Cells = xcatformat; n_label.Data = info; } }