Unplanned
Last Updated: 28 Jan 2022 15:53 by ADMIN
Kasim
Created on: 24 Jan 2022 05:50
Category: HtmlChart
Type: Feature Request
2
Show a message when there is no data in Html Chart EmptyMessage
When there is no data in the source of the chart, the plot area should be displaying a message in predefined format. Something similar to what we have in the Grid and other controls.
1 comment
ADMIN
Vessy
Posted on: 28 Jan 2022 15:53

Hello Kasim,

Thanks a lot for the summited feature request!

We will track the overall interest about such implementation, meanwhile you can use an approach similar to the one demonstrated in the following article to achieve it:

https://docs.telerik.com/kendo-ui/controls/charts/how-to/appearance/show-no-data-available-message

In ASP.NET AJAX scenario this solution will look like follows:

    <style>
        .container {
            position: relative;
        }

        .overlay {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            opacity: .2;
            background-color: #6495ed;
            text-align: center;
        }

            .overlay div {
                position: relative;
                font-size: 34px;
                margin-top: -17px;
                top: 50%;
            }
    </style>
...
        <div class="container">
            <div class="overlay"><div>No data available</div></div>
                <telerik:RadHtmlChart ID="RadHtmlChart2" runat="server">
                    <ClientEvents OnLoad="onChartLoad" />
                </telerik:RadHtmlChart>
        </div>
        <script>
            var $ = $ || $telerik.$;

            function onChartLoad(chartO, args) {
                var chart = chartO.get_kendoWidget();
                var view = chart.dataSource.view();
                $(".overlay").toggle(view.length === 0);
            }
        </script>

 

Regards,
Vessy
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.