Example #1
0
        //
        // GET: /ShapesGallery/
        public ActionResult TableDataBinding()
        {
            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");
            TableMapping TableMapping = new TableMapping();

            TableMapping.HeaderMapping = new HeaderMapping()
            {
                PropertyName = "ProductName", DisplayName = "Product Name", ColumnStyle = new ColumnStyle()
                {
                    Width = 140, TextAlign = HeatMapTextAlign.Right
                }
            };
            TableMapping.ColumnMapping.Add(new HeaderMapping()
            {
                PropertyName = "Y2010", DisplayName = "Y2010"
            });
            TableMapping.ColumnMapping.Add(new HeaderMapping()
            {
                PropertyName = "Y2011", DisplayName = "Y2011"
            });
            TableMapping.ColumnMapping.Add(new HeaderMapping()
            {
                PropertyName = "Y2012", DisplayName = "Y2012"
            });
            TableMapping.ColumnMapping.Add(new HeaderMapping()
            {
                PropertyName = "Y2013", DisplayName = "Y2013"
            });
            TableMapping.ColumnMapping.Add(new HeaderMapping()
            {
                PropertyName = "Y2014", DisplayName = "Y2014"
            });
            TableMapping.ColumnMapping.Add(new HeaderMapping()
            {
                PropertyName = "Y2015", DisplayName = "Y2015"
            });
            Heatmap.ItemsMapping     = TableMapping;
            Heatmap.IsResponsive     = true;
            Heatmap.ItemsSource      = GetTableSource();
            Heatmap.Width            = "100%";
            ViewData["HeatMapModel"] = Heatmap;

            HeatMapLegendProperties legend = new HeatMapLegendProperties();

            legend.ColorMappingCollection = colorCollection;
            legend.Orientation            = HeatMapLegendOrientation.Horizontal;
            legend.LegendMode             = HeatMapLegendMode.Gradient;
            legend.Height                  = "50px";
            legend.Width                   = "75%";
            legend.IsResponsive            = true;
            ViewData["HeatMapLegendModel"] = legend;
            return(View());
        }
Example #2
0
        //
        // GET: /ShapesGallery/
        public ActionResult Legend()
        {
            HeatMapProperties          Heatmap         = new HeatMapProperties();
            List <HeatMapColorMapping> colorCollection = new List <HeatMapColorMapping>();

            colorCollection.Add(new HeatMapColorMapping()
            {
                Color = "#fe0002", Label = new HeatMapLabel()
                {
                    Text = "Poor"
                }, Value = 0
            });
            colorCollection.Add(new HeatMapColorMapping()
            {
                Color = "#ffff01", Label = new HeatMapLabel()
                {
                    Text = "Average"
                }, Value = 3
            });
            colorCollection.Add(new HeatMapColorMapping()
            {
                Color = "#13ab11", Label = new HeatMapLabel()
                {
                    Text = "Good"
                }, Value = 6
            });
            colorCollection.Add(new HeatMapColorMapping()
            {
                Color = "#005ba2", Label = new HeatMapLabel()
                {
                    Text = "Excellent"
                }, Value = 10
            });
            Heatmap.ColorMappingCollection = colorCollection;
            Heatmap.IsResponsive           = true;
            Heatmap.LegendCollection.Add("heatmapLegend");


            TableMapping TableMapping = new TableMapping();

            TableMapping.HeaderMapping = new HeaderMapping()
            {
                PropertyName = "EmpName", DisplayName = "Employee Name", ColumnStyle = new ColumnStyle()
                {
                    Width = 100, TextAlign = HeatMapTextAlign.Right
                }
            };
            TableMapping.ColumnMapping.Add(new HeaderMapping()
            {
                PropertyName = "January", DisplayName = "January"
            });
            TableMapping.ColumnMapping.Add(new HeaderMapping()
            {
                PropertyName = "February", DisplayName = "February"
            });
            TableMapping.ColumnMapping.Add(new HeaderMapping()
            {
                PropertyName = "March", DisplayName = "March"
            });
            TableMapping.ColumnMapping.Add(new HeaderMapping()
            {
                PropertyName = "April", DisplayName = "April"
            });
            TableMapping.ColumnMapping.Add(new HeaderMapping()
            {
                PropertyName = "May", DisplayName = "May"
            });
            TableMapping.ColumnMapping.Add(new HeaderMapping()
            {
                PropertyName = "June", DisplayName = "June"
            });
            TableMapping.ColumnMapping.Add(new HeaderMapping()
            {
                PropertyName = "July", DisplayName = "July"
            });
            TableMapping.ColumnMapping.Add(new HeaderMapping()
            {
                PropertyName = "August", DisplayName = "August"
            });
            TableMapping.ColumnMapping.Add(new HeaderMapping()
            {
                PropertyName = "September", DisplayName = "September"
            });
            TableMapping.ColumnMapping.Add(new HeaderMapping()
            {
                PropertyName = "October", DisplayName = "October"
            });
            TableMapping.ColumnMapping.Add(new HeaderMapping()
            {
                PropertyName = "November", DisplayName = "November"
            });
            TableMapping.ColumnMapping.Add(new HeaderMapping()
            {
                PropertyName = "December", DisplayName = "December"
            });
            Heatmap.ItemsMapping = TableMapping;
            //Heatmap.Height = "auto";
            Heatmap.Width            = "100%";
            Heatmap.ItemsSource      = GetLegendSource();
            ViewData["HeatMapModel"] = Heatmap;

            HeatMapLegendProperties legend = new HeatMapLegendProperties();

            legend.ColorMappingCollection = colorCollection;
            legend.Orientation            = HeatMapLegendOrientation.Horizontal;
            legend.LegendMode             = HeatMapLegendMode.Gradient;
            legend.Height                  = "50px";
            legend.Width                   = "75%";
            legend.IsResponsive            = true;
            ViewData["HeatMapLegendModel"] = legend;
            return(View());
        }
Example #3
0
        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());
        }
        //
        // 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());
        }