New to Telerik UI for ASP.NET MVCStart a free 30-day trial

Showing a Message When the Chart Has No Data

Environment

ProductTelerik UI for ASP.NET MVC Chart
Progress Telerik UI for ASP.NET MVC versionCreated with the 2022.2.802 version

Description

How can I display a message in the Telerik UI for ASP.NET MVC Chart when its data source is empty?

Solution

The following example demonstrates how to achieve such behavior in the Telerik UI for ASP.NET MVC Chart. Note that the div element of the message is positioned and decorated through CSS.

Index.cshtml

    @(Html.Kendo().Chart()
        .Name("chart")
        .Title("Site Visitors Stats")
        .Events(ev=>ev.Render("onRender"))
    )

For the complete implementation of the suggested approach, refer to the Telerik REPL example on displaying the Telerik UI for ASP.NET MVC Chart when its data source is empty.

More ASP.NET MVC Chart Resources

See Also