Data Visualization with a Heat Map Using .NET MAUI Scheduler
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (180).NET Core  (28).NET MAUI  (224)Angular  (113)ASP.NET  (49)ASP.NET Core  (81)ASP.NET MVC  (87)Azure  (41)Black Friday Deal  (1)Blazor  (234)BoldSign  (14)DocIO  (24)Essential JS 2  (110)Essential Studio  (199)File Formats  (72)Flutter  (135)JavaScript  (226)Microsoft  (121)PDF  (83)Python  (1)React  (105)Streamlit  (1)Succinctly series  (131)Syncfusion  (960)TypeScript  (33)Uno Platform  (3)UWP  (3)Vue  (46)Webinar  (53)Windows Forms  (59)WinUI  (72)WPF  (162)Xamarin  (159)XlsIO  (38)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (10)Business intelligence  (55)Button  (4)C#  (163)Chart  (145)Chart of the week  (57)Cloud  (15)Company  (440)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (73)Development  (676)Doc  (7)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (7)Essential Tools  (13)Excel  (43)Extensions  (23)File Manager  (7)Gantt  (20)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (519)Mobile MVC  (9)OLAP server  (2)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (45)Performance  (13)PHP  (2)PivotGrid  (5)Predictive Analytics  (6)Report Server  (3)Reporting  (8)Reporting / Back Office  (9)Rich Text Editor  (12)Road Map  (12)Scheduler  (54)Security  (5)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (32)Solution Services  (4)Spreadsheet  (11)SQL  (15)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (113)UI  (400)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (624)What's new  (337)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Data Visualization with a Heat Map Using .NET MAUI Scheduler

Data Visualization with a Heat Map Using .NET MAUI Scheduler

A heat map is a visual representation of data over time. Heat maps are widely used in various fields, including finance, healthcare, and education. Colors in a heat map represent a range of values, such as a user’s activity level throughout the day or week.

Using a heat map on a calendar, users can quickly determine which days are typically busier. This information can be used to modify their schedule or organize their work more efficiently.

This blog post will explore designing a heat map calendar using the .NET MAUI Scheduler. In this example, we will use the Scheduler to track daily support ticket traffic. Support traffic refers to the volume of requests for information or problem fixes a company or organization receives. The Syncfusion .NET MAUI Scheduler provides customization options and allows users to design a heat map calendar by customizing the month cells.

Heat map calendar using .NET MAUI Scheduler
Heat map calendar using .NET MAUI Scheduler

Note: If you are new to our .NET MAUI Scheduler control, please refer to its getting started documentation before proceeding.

Choosing a color scheme to visualize support traffic

In this example, we chose a sequential color scheme, which uses a range of colors from light to dark to represent increasing values. The color scheme uses increasingly dark shades of blue to represent increasing numbers of support requests. This can help clarify the information presented in the heat map.

The color scheme for the .NET MAUI Scheduler heat map calendar
The color scheme for the .NET MAUI Scheduler heat map calendar

Importing the support data to the Scheduler

Import the support data to the Scheduler in the following steps:

  1. Create the support data model.
  2. Create the support data collection.
  3. Map the support data to the Scheduler.

Create the support data model

We first need to define a data model that includes the necessary support details, such as the date of the support request and the corresponding request count.

public class SupportDetails
{
    /// <summary>
    /// Date of the support detail.
    /// </summary>
    public DateTime Date { get; set; }

    /// <summary>
    /// Support count for the date.
    /// </summary>
    public int Value { get; set; }
}

Create the support data collection

Support traffic details can be stored in various formats, depending on your organization’s available resources and tools. For demonstration purposes, we have manually provided support data for the last 100 days, which will be used to render the month cell background color in the Scheduler.

public class HeatmapViewModel
{
    public List<SupportDetails> SupportDetails { get; set; }

    public DateTime MaxDate { get; set; }

    public HeatmapViewModel()
    {
        this.MaxDate = DateTime.Today;
        this.GenerateSupportDetails();
    }

    private void GenerateSupportDetails()
    {
        this.SupportDetails = new List<SupportDetails>();
        for (int startDate = -100; startDate <= 0; startDate++)
        {
            DateTime date = DateTime.Today.AddDays(startDate);
            int supportCount = this.GetSupportCount(date);
            SupportDetails supportDetails = new SupportDetails()
            {
                Date = date,
                SupportCount = supportCount
            };
            this.SupportDetails.Add(supportDetails);
        }
    }

    private int GetSupportCount(DateTime date)
    {
        if (date.Month % 2 == 0)
        {
            if (date.Day % 6 == 0)
            {
                // 6, 12, 18, 24, 30
                return 2248;
            }
            else if (date.Day % 5 == 0)
            {
                // 5, 10, 15, 20, 25
                return 1364;
            }
            else if (date.Day % 4 == 0)
            {
                //  4, 8, 16, 24, 28
                return 1976;
            }
            else if (date.Day % 3 == 0)
            {
                // 3, 9, 18, 21, 27
                return 417;
            }
            else
            {
                // 1, 2, 7, 11, 13, 19, 22, 23, 26, 29
                return 891;
            }
        }
        else
        {
            if (date.Day % 6 == 0)
            {
                // 6, 12, 18, 24, 30
                return 891;
            }
            else if (date.Day % 5 == 0)
            {
                // 5, 10, 15, 20, 25
                return 417;
            }
            else if (date.Day % 4 == 0)
            {
                //  4, 8, 16, 24, 28
                return 1364;
            }
            else if (date.Day % 3 == 0)
            {
                // 3, 9, 18, 21, 27
                return 2248;
            }
            else
            {
                // 1, 2, 7, 11, 13, 19, 22, 23, 26, 29
                return 1976;
            }
        }
    }
}

Map the support data to the Scheduler

To link the custom support data object to the Scheduler, configure the AppointmentMapping property in it. Once the mapping is complete, assign the collection of support data objects to the AppointmentsSource property.

This generates the appointment details in the MonthCell, which displays the support traffic details for each day. The background color of the MonthCell is determined based on the number of support tickets received on that day.

<schedule:SfScheduler x:Name="Scheduler" View="Month" AppointmentsSource="{Binding SupportDetails}" MaximumDateTime="{Binding MaxDate}" CellBorderBrush="Transparent">
 <schedule:SfScheduler.AppointmentMapping>
  <schedule:SchedulerAppointmentMapping StartTime="Date" EndTime="Date"/>
 </schedule:SfScheduler.AppointmentMapping>

Designing the heat map calendar

Designing a heat map calendar involves visualizing data in a calendar format, where each cell represents a day, and the background color represents the data’s intensity or value.

In the Syncfusion .NET MAUI Scheduler, you can customize the month cell’s appearance based on data using the CellTemplate property in CalendarMonthView. To avoid appointments rendering on the month cells, set the AppointmentDisplayMode property in CalendarMonthView to None.

Refer to the following code to design a heat map calendar using the CellTemplate in CalendarMonthView.

<schedule:SfScheduler x:Name="Scheduler" View="Month" AppointmentsSource="{Binding SupportDetails}" MaximumDateTime="{Binding MaxDate}" CellBorderBrush="Transparent">
 <schedule:SfScheduler.AppointmentMapping>
  <schedule:SchedulerAppointmentMapping StartTime="Date" EndTime="Date"/>
 </schedule:SfScheduler.AppointmentMapping>
 <schedule:SfScheduler.MonthView>
  <schedule:SchedulerMonthView AppointmentDisplayMode="None" ShowLeadingAndTrailingDates="False">
<schedule:SchedulerMonthView.CellTemplate> <DataTemplate> <Grid x:Name="cellGrid" Background="{Binding Appointments, Converter={StaticResource colorConverter}}" Margin="0.25"> <Label Text="{Binding DateTime.Day}" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" TextColor="{Binding Appointments, Converter={StaticResource textColorConverter}}"> </Label> </Grid> </DataTemplate> </schedule:SchedulerMonthView.CellTemplate> </schedule:SchedulerMonthView> </schedule:SfScheduler.MonthView> </schedule:SfScheduler>
Heatmap calendar designed using .NET MAUI Scheduler
Heatmap calendar designed using .NET MAUI Scheduler

GitHub reference

For more information, refer to designing a heat map using the .NET MAUI Scheduler demo.

Conclusion

Thank you for your time! This blog post briefly overviewed designing a heat map calendar using the Syncfusion .NET MAUI Scheduler. With it, you can create visually stunning and highly functional heat map calendars that provide valuable insights into complex data sets.

Check out our other .NET MAUI controls and demos on GitHub and share your feedback or ask questions in the comments section below.

If you are not a Syncfusion customer, try our 30-day free trial to see how our components can enhance your projects.

You can also reach us through our support forum, support portal, or feedback portal. We are always happy to assist you!

Test Flight
App Center Badge
Google Play Store Badge
Microsoft Badge
Github Store Badge

Related blogs

Tags:

Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed