This is a migrated thread and some comments may be shown as answers.

Empty DataSource

3 Answers 129 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Monique
Top achievements
Rank 1
Monique asked on 16 Apr 2012, 11:19 PM
Hello,

I want to know if I can show a message in my chart ; when my datasource is empty.
Saying that there are no records


Regards,

M.

3 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 19 Apr 2012, 07:11 AM
Hi M,

Such functionality is not supported out of the box, but you could achieve it using custom code. I could suggest the following approach:
  • Create a function which place a <div> or <p> with the following styling over the Kendo UI Chart: 

    <script>
    function overlay(e) {
      $('<div class="custom-overlay"><p id="message">SomeMessageHere</p></div>').appendTo("#ComfortChart");
    }
    ...
    </script>
     
    ...
      
    <style>
     .custom-overlay {
       width: 100%;
       height: 100%;
       position: absolute;
       top: 0;
       left: 0;
       opacity: .2;
       filter: alpha(opacity=60);
       background-color: #6495ed;
       font-size: 34px;
     }
     #message{
       position: absolute; left: 30%; top: 50%;
     }   
    ​</style>

Greetings,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Monique
Top achievements
Rank 1
answered on 19 Apr 2012, 03:04 PM
Hi Iliana,

Where I have to put the function overlay;
I tried on databound event
but it doesn´t appear

M

Regards,
Thanks for the help.
0
Iliana Dyankova
Telerik team
answered on 20 Apr 2012, 07:46 AM
Hi M,

You could call the overlay() function after the initialization of the chart. For example:
$(document).ready(function() {
   createChart();
   overlay();
});​

Please check this jsFiddle example.
 

Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Monique
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Monique
Top achievements
Rank 1
Share this question
or