Data Visualization with a Heat Map Using .NET MAUI Scheduler
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (173).NET Core  (29).NET MAUI  (203)Angular  (107)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (40)Black Friday Deal  (1)Blazor  (211)BoldSign  (13)DocIO  (24)Essential JS 2  (106)Essential Studio  (200)File Formats  (65)Flutter  (132)JavaScript  (219)Microsoft  (118)PDF  (81)Python  (1)React  (98)Streamlit  (1)Succinctly series  (131)Syncfusion  (897)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (50)Windows Forms  (61)WinUI  (68)WPF  (157)Xamarin  (161)XlsIO  (35)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (146)Chart  (127)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (63)Development  (618)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (39)Extensions  (22)File Manager  (6)Gantt  (18)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  (501)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (42)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (10)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (381)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (17)Web  (582)What's new  (323)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