public void AddControl(Control control, int column, int row, int columnSpan = 1, int rowSpan = 1) { if (control == null) { throw new ArgumentNullException("control"); } if (column < 0 || column > Columns.Count - 1) { throw new ArgumentOutOfRangeException("column"); } if (row < 0 || row > Rows.Count - 1) { throw new ArgumentOutOfRangeException("row"); } if (columnSpan < 1) { throw new ArgumentOutOfRangeException("columnSpan"); } if (rowSpan < 1) { throw new ArgumentOutOfRangeException("rowSpan"); } var mapping = new CellMapping(control); for (int x = 0; x < columnSpan; x++) { int colIndex = column + x; if (colIndex < 0) { continue; } if (colIndex >= Columns.Count) { continue; } mapping.Columns.Add(Columns[colIndex]); } for (int y = 0; y < rowSpan; y++) { int rowIndex = row + y; if (rowIndex < 0) { continue; } if (rowIndex >= Rows.Count) { continue; } mapping.Rows.Add(Rows[rowIndex]); } cellMapping.Add(mapping); Children.Add(control); }
// GET: /<controller>/ public ActionResult CellMapping() { CellMapping CellMapping = new CellMapping(); CellMapping.Column = new PropertyMapping() { PropertyName = "ProductName", DisplayName = "Product Name" }; CellMapping.Row = new PropertyMapping() { PropertyName = "Year", DisplayName = "Year" }; CellMapping.Value = new PropertyMapping() { PropertyName = "Value" }; Collection columnMapping = new Collection(); columnMapping.Add(new HeaderMapping() { PropertyName = "Vegie-spread", DisplayName = "Vegie-spread" }); columnMapping.Add(new HeaderMapping() { PropertyName = "Tofuaa", DisplayName = "Tofuaa" }); columnMapping.Add(new HeaderMapping() { PropertyName = "Alice Mutton", DisplayName = "Alice Mutton" }); columnMapping.Add(new HeaderMapping() { PropertyName = "Konbu", DisplayName = "Konbu" }); columnMapping.Add(new HeaderMapping() { PropertyName = "Fløtemysost", DisplayName = "Fløtemysost" }); columnMapping.Add(new HeaderMapping() { PropertyName = "Perth Pasties", DisplayName = "Perth Pasties" }); CellMapping.ColumnMapping = columnMapping; HeaderMapping headerMapping = new HeaderMapping() { PropertyName = "Year", DisplayName = "Year", ColumnStyle = new ColumnStyle() { Width = 105, TextAlign = HeatMapTextAlign.Right } }; CellMapping.HeaderMapping = headerMapping; ViewBag.itemsource = GetCellSource(); ViewBag.itemsmapping = CellMapping; List <string> collection = new List <string>(); collection.Add("heatmapLegend"); ViewBag.legendcollection = collection; return(View()); }
public Cell CreateCell(int x, int y) { var cell = new Cell(x, y); Cells.Add(cell); CellMapping.Add(cell.Position, cell); return(cell); }
public void CreateHeatmap() { heatmap.LegendCollection.Add("heatmapLegend"); CellMapping CellMapping = new CellMapping(); CellMapping.Column = new PropertyMapping() { PropertyName = "ProductName", DisplayName = "Product Name" }; CellMapping.Row = new PropertyMapping() { PropertyName = "Year", DisplayName = "Year" }; CellMapping.Value = new PropertyMapping() { PropertyName = "Value" }; Collection columnMapping = new Collection(); columnMapping.Add(new HeaderMapping() { PropertyName = "Vegie-spread", DisplayName = "Vegie-spread" }); columnMapping.Add(new HeaderMapping() { PropertyName = "Tofuaa", DisplayName = "Tofuaa" }); columnMapping.Add(new HeaderMapping() { PropertyName = "Alice Mutton", DisplayName = "Alice Mutton" }); columnMapping.Add(new HeaderMapping() { PropertyName = "Konbu", DisplayName = "Konbu" }); columnMapping.Add(new HeaderMapping() { PropertyName = "Fløtemysost", DisplayName = "Fløtemysost" }); columnMapping.Add(new HeaderMapping() { PropertyName = "Perth Pasties", DisplayName = "Perth Pasties" }); CellMapping.ColumnMapping = columnMapping; HeaderMapping headerMapping = new HeaderMapping() { PropertyName = "Year", DisplayName = "Year", ColumnStyle = new ColumnStyle() { Width = 105, TextAlign = HeatMapTextAlign.Right } }; CellMapping.HeaderMapping = headerMapping; heatmap.ItemsSource = GetCellSource(); heatmap.ItemsMapping = CellMapping; }
private void AddButton_OnItemClick(object sender, ItemClickEventArgs e) { var cm = new CellMapping(); cm.ColumnName = "1"; cm.ColumnExcelNumber = "A1"; var list = GridControl.ItemsSource as List <CellMapping>; list.Add(cm); }
public override void ImportRow(ExcelRange cells, int row) { var cell = new CellMapping { FileId = FileId, ColumnNumber = cells[row, 1].Text.ConvertData(0), ColumnExcelNumber = cells[row, 2].Text, ColumnName = cells[row, 3].Text, Group = (CalculatGroup)cells[row, 4].Text.ConvertData(0), Formula = cells[row, 5].Text, Digital = cells[row, 6].Text.ConvertData(2) }; Context.CellMappings.Add(cell); }
private Syncfusion.UI.Xaml.HeatMap.ItemsMapping GetCellModel() { CellMapping cell = new CellMapping(); cell.Column = new ColumnMapping() { PropertyName = "ProductName", DisplayName = "Product Name" }; cell.Row = new ColumnMapping() { PropertyName = "Year", DisplayName = "Year", }; cell.Value = new ColumnMapping() { PropertyName = "Value" }; return(cell); }
private void SetDay(int iCol, int iRow, CalendarDayData data) { var cellMap = _cellMapping.FirstOrDefault(x => x.ICol == iCol && x.IRow == iRow); if (cellMap == null) { // create new cellMap = new CellMapping() { ICol = iCol, IRow = iRow, Control = new CalendarDayControl() }; // add to the list _cellMapping.Add(cellMap); // fill cell in grid Grid.SetColumn(cellMap.Control, cellMap.ICol); Grid.SetRow(cellMap.Control, cellMap.IRow); daysGrid.Children.Add(cellMap.Control); } // make sure grid contains correspond row if (daysGrid.Rows < iRow + 1) { daysGrid.Rows = iRow + 1; } if (cellMap.Control.Parent == null) { daysGrid.Children.Add(cellMap.Control); } cellMap.Control.Visibility = Visibility.Visible; cellMap.Control.Data = data; }
/// <summary> /// 单元格格式化 /// </summary> /// <param name="tableName">表名</param> /// <param name="field">字段名</param> /// <param name="value">单元格值</param> /// <param name="dr">当前行</param> /// <returns></returns> public static string CellFormat(string tableName, string field, string value, DataRow dr) { //格式化后的值 string result = value; try { switch (tableName.ToLower()) { //角色 case "sysrole": { switch (field.ToLower()) { //时间 case "srcreatetime": result = CellMapping.DateTimeFormat(value); break; //状态 case "srstatus": result = CellMapping.Status01(value); break; } } break; //用户 case "sysuser": { switch (field.ToLower()) { //角色ID case "srid": result = dr["SrName"].ToString(); break; //时间 case "sucreatetime": result = CellMapping.DateTimeFormat(value, "yyyy-MM-dd HH:mm:ss"); break; //状态 case "sustatus": result = CellMapping.Status01(value); break; } } break; //日志 case "syslog": { switch (field.ToLower()) { //时间 case "logcreatetime": result = CellMapping.DateTimeFormat(value, "yyyy-MM-dd HH:mm:ss"); break; } } break; //数据字典 case "sysdictionary": { switch (field.ToLower()) { //状态 case "sdstatus": result = CellMapping.Status03(value); break; } } break; } } catch (Exception) { } return(result); }
public ActionResult HeatMapFeatures() { HeatMapProperties Heatmap = new HeatMapProperties(); List <HeatMapColorMapping> colorCollection = new List <HeatMapColorMapping>(); colorCollection.Add(new HeatMapColorMapping() { Color = "#0080FF", Label = new HeatMapLabel() { Text = "0" }, Value = 0 }); colorCollection.Add(new HeatMapColorMapping() { Color = "#8181F7", Label = new HeatMapLabel() { Text = "10" }, Value = 10 }); colorCollection.Add(new HeatMapColorMapping() { Color = "#81DAF5", Label = new HeatMapLabel() { Text = "20" }, Value = 20 }); colorCollection.Add(new HeatMapColorMapping() { Color = "#81F7BE", Label = new HeatMapLabel() { Text = "30" }, Value = 30 }); colorCollection.Add(new HeatMapColorMapping() { Color = "#81F781", Label = new HeatMapLabel() { Text = "40" }, Value = 40 }); colorCollection.Add(new HeatMapColorMapping() { Color = "#BEF781", Label = new HeatMapLabel() { Text = "50" }, Value = 50 }); colorCollection.Add(new HeatMapColorMapping() { Color = "#F3F781", Label = new HeatMapLabel() { Text = "60" }, Value = 60 }); colorCollection.Add(new HeatMapColorMapping() { Color = "#F7BE81", Label = new HeatMapLabel() { Text = "70" }, Value = 70 }); colorCollection.Add(new HeatMapColorMapping() { Color = "#F78181", Label = new HeatMapLabel() { Text = "80" }, Value = 80 }); colorCollection.Add(new HeatMapColorMapping() { Color = "#FE642E", Label = new HeatMapLabel() { Text = "90" }, Value = 90 }); colorCollection.Add(new HeatMapColorMapping() { Color = "#2EFE2E", Label = new HeatMapLabel() { Text = "100" }, Value = 100 }); Heatmap.ColorMappingCollection = colorCollection; Heatmap.IsResponsive = false; Heatmap.LegendCollection.Add("heatmapLegend"); Heatmap.HeatMapCell.ShowColor = true; Heatmap.HeatMapCell.ShowContent = HeatMapCellVisibility.Visible; Heatmap.Width = "auto"; Heatmap.Height = "auto"; CellMapping CellMapping = new CellMapping(); CellMapping.Column = new PropertyMapping() { PropertyName = "ProductName", DisplayName = "Product Name" }; CellMapping.Row = new PropertyMapping() { PropertyName = "Year", DisplayName = "Year" }; CellMapping.Value = new PropertyMapping() { PropertyName = "Value" }; Collection columnMapping = new Collection(); columnMapping.Add(new HeaderMapping() { PropertyName = "Vegie-spread", DisplayName = "Vegie-spread", ColumnStyle = new ColumnStyle() { TextAlign = HeatMapTextAlign.Left, Width = 200 } }); columnMapping.Add(new HeaderMapping() { PropertyName = "Tofuaa", DisplayName = "Vegie-spread", ColumnStyle = new ColumnStyle() { TextAlign = HeatMapTextAlign.Left, Width = 200 } }); columnMapping.Add(new HeaderMapping() { PropertyName = "Alice Mutton", DisplayName = "Vegie-spread", ColumnStyle = new ColumnStyle() { TextAlign = HeatMapTextAlign.Left, Width = 200 } }); columnMapping.Add(new HeaderMapping() { PropertyName = "Konbu", DisplayName = "Vegie-spread", ColumnStyle = new ColumnStyle() { TextAlign = HeatMapTextAlign.Left, Width = 200 } }); columnMapping.Add(new HeaderMapping() { PropertyName = "Fløtemysost", DisplayName = "Vegie-spread", ColumnStyle = new ColumnStyle() { TextAlign = HeatMapTextAlign.Left, Width = 200 } }); columnMapping.Add(new HeaderMapping() { PropertyName = "Perth Pasties", DisplayName = "Vegie-spread", ColumnStyle = new ColumnStyle() { TextAlign = HeatMapTextAlign.Left, Width = 200 } }); CellMapping.ColumnMapping = columnMapping; HeaderMapping headerMapping = new HeaderMapping() { PropertyName = "Year", DisplayName = "Year", ColumnStyle = new ColumnStyle() { TextAlign = HeatMapTextAlign.Left, Width = 200 } }; CellMapping.HeaderMapping = headerMapping; Heatmap.ItemsSource = GetRowSource(); Heatmap.ItemsMapping = CellMapping; ViewData["heatmapModel"] = Heatmap; HeatMapLegendProperties legend = new HeatMapLegendProperties(); legend.ColorMappingCollection = colorCollection; legend.Orientation = HeatMapLegendOrientation.Horizontal; legend.LegendMode = Syncfusion.JavaScript.DataVisualization.HeatMapEnums.HeatMapLegendMode.Gradient; legend.Height = "50px"; legend.Width = "100%"; ViewData["heatmapLegendModel"] = legend; return(View()); }
public void AddControl(Control control, int column, int row, int columnSpan = 1, int rowSpan = 1) { if (control == null) throw new ArgumentNullException("control"); if (column < 0 || column > Columns.Count - 1) throw new ArgumentOutOfRangeException("column"); if (row < 0 || row > Rows.Count - 1) throw new ArgumentOutOfRangeException("row"); if (columnSpan < 1) throw new ArgumentOutOfRangeException("columnSpan"); if (rowSpan < 1) throw new ArgumentOutOfRangeException("rowSpan"); var mapping = new CellMapping(control); for (int x = 0; x < columnSpan; x++) { int colIndex = column + x; if (colIndex < 0) continue; if (colIndex >= Columns.Count) continue; mapping.Columns.Add(Columns[colIndex]); } for (int y = 0; y < rowSpan; y++) { int rowIndex = row + y; if (rowIndex < 0) continue; if (rowIndex >= Rows.Count) continue; mapping.Rows.Add(Rows[rowIndex]); } cellMapping.Add(mapping); Children.Add(control); }
// // GET: /ShapesGallery/ public ActionResult Default() { HeatMapProperties Heatmap = new HeatMapProperties(); List <HeatMapColorMapping> colorCollection = new List <HeatMapColorMapping>(); colorCollection.Add(new HeatMapColorMapping() { Color = "#8ec8f8", Label = new HeatMapLabel() { Text = "0" }, Value = 0 }); colorCollection.Add(new HeatMapColorMapping() { Color = "#0d47a1", Label = new HeatMapLabel() { Text = "100" }, Value = 100 }); Heatmap.ColorMappingCollection = colorCollection; Heatmap.LegendCollection.Add("heatmapLegend"); Heatmap.Width = "100%"; //Heatmap.Height = "auto"; CellMapping CellMapping = new CellMapping(); CellMapping.Column = new PropertyMapping() { PropertyName = "ProductName", DisplayName = "Product Name" }; CellMapping.Row = new PropertyMapping() { PropertyName = "Year", DisplayName = "Year" }; CellMapping.Value = new PropertyMapping() { PropertyName = "Value" }; Collection columnMapping = new Collection(); columnMapping.Add(new HeaderMapping() { PropertyName = "Vegie-spread", DisplayName = "Vegie-spread" }); columnMapping.Add(new HeaderMapping() { PropertyName = "Tofuaa", DisplayName = "Tofuaa" }); columnMapping.Add(new HeaderMapping() { PropertyName = "Alice Mutton", DisplayName = "Alice Mutton" }); columnMapping.Add(new HeaderMapping() { PropertyName = "Konbu", DisplayName = "Konbu" }); columnMapping.Add(new HeaderMapping() { PropertyName = "Fløtemysost", DisplayName = "Fløtemysost" }); columnMapping.Add(new HeaderMapping() { PropertyName = "Perth Pasties", DisplayName = "Perth Pasties" }); CellMapping.ColumnMapping = columnMapping; HeaderMapping headerMapping = new HeaderMapping() { PropertyName = "Year", DisplayName = "Year", ColumnStyle = new ColumnStyle() { Width = 105, TextAlign = HeatMapTextAlign.Right } }; CellMapping.HeaderMapping = headerMapping; Heatmap.ItemsSource = GetCellSource(); Heatmap.ItemsMapping = CellMapping; Heatmap.IsResponsive = true; ViewData["HeatMapModel"] = Heatmap; HeatMapLegendProperties legend = new HeatMapLegendProperties(); legend.ColorMappingCollection = colorCollection; legend.Orientation = HeatMapLegendOrientation.Horizontal; legend.LegendMode = Syncfusion.JavaScript.DataVisualization.HeatMapEnums.HeatMapLegendMode.Gradient; legend.Height = "50px"; legend.Width = "75%"; legend.IsResponsive = true; ViewData["HeatMapLegendModel"] = legend; return(View()); }