|
| 1 | +@page "/title" |
| 2 | + |
| 3 | +@using Syncfusion.Blazor.HeatMap |
| 4 | +<AppearanceRoute></AppearanceRoute> |
| 5 | + |
| 6 | +<SfHeatMap DataSource="@HeatMapData"> |
| 7 | + <HeatMapXAxis Labels="@XAxisLabels"></HeatMapXAxis> |
| 8 | + <HeatMapYAxis Labels="@YAxisLabels"></HeatMapYAxis> |
| 9 | + <HeatMapTitleSettings Text="Sales Revenue per Employee (in 1000 US$)"> |
| 10 | + <HeatMapTitleTextStyle Size = "15px" FontWeight = "500" FontStyle = "Italic" FontFamily = "Segoe UI"></HeatMapTitleTextStyle> |
| 11 | + </HeatMapTitleSettings> |
| 12 | + <HeatMapCellSettings ShowLabel="true" TileType="CellType.Rect"></HeatMapCellSettings> |
| 13 | + <HeatMapMargin Left="15" Right="15" Top="15" Bottom="15"></HeatMapMargin> |
| 14 | + <HeatMapLegendSettings ShowLabel="true" Position="LegendPosition.Right" EnableSmartLegend="true" ToggleVisibility="true"></HeatMapLegendSettings> |
| 15 | +</SfHeatMap> |
| 16 | + |
| 17 | +@code{ |
| 18 | + int[,] GetDefaultData() |
| 19 | + { |
| 20 | + int[,] dataSource = new int[,] |
| 21 | + { |
| 22 | + {73, 39, 26, 39, 94, 0}, |
| 23 | + {93, 58, 53, 38, 26, 68}, |
| 24 | + {99, 28, 22, 4, 66, 90}, |
| 25 | + {14, 26, 97, 69, 69, 3}, |
| 26 | + {7, 46, 47, 47, 88, 6}, |
| 27 | + {41, 55, 73, 23, 3, 79} |
| 28 | + }; |
| 29 | + return dataSource; |
| 30 | + } |
| 31 | + string[] XAxisLabels = new string[] {"Nancy", "Andrew", "Janet", "Margaret", "Steven", "Michael" }; |
| 32 | + string[] YAxisLabels = new string[] { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; |
| 33 | + public object HeatMapData { get; set; } |
| 34 | + protected override void OnInitialized() |
| 35 | + { |
| 36 | + HeatMapData = GetDefaultData(); |
| 37 | + } |
| 38 | +} |
0 commit comments