How to show blank chart when no data (w/o axes)

6 posts, 1 answers
  1. Ed
    Ed avatar
    168 posts
    Member since:
    Sep 2013

    Posted 30 Mar 2015 Link to this post

    For my column charts, when there is no data, it shows the Value & Category axes without any data, which is fine, but when there is no data for my pie charts, it also shows the Value and Category axes, which is misleading. How can I have the pie charts show a blank chart (no Value/Category axes) when there is no data?
    Thanks,
    --Ed
  2. Answer
    Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2622 posts

    Posted 01 Apr 2015 Link to this post

    Hi Ed,

    When there is no data Kendo UI Pie Chart should be blank (dojo example). Could you please modify the test example and demonstrate your exact setup - this way I would be able to advice you further and provide concrete recommendations.

    Regards,
    Iliana Nikolova
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Ed
    Ed avatar
    168 posts
    Member since:
    Sep 2013

    Posted 01 Apr 2015 in reply to Iliana Nikolova Link to this post

    Hi Iliana,
    Found this issue - I was setting the chart type in the series option, but when there's no data, that won't work. I've added it to the seriesDefault option as well for this specific case.
    Thanks,
    --Ed
  4. Ed
    Ed avatar
    168 posts
    Member since:
    Sep 2013

    Posted 01 Apr 2015 in reply to Iliana Nikolova Link to this post

    Hi Iliana,
    I found the issue. I was setting the chart type in the series option, but when there's no data, it will use the chart type from seriesDefault, which was not set. I'm setting seriesDefault now and the problem is solved.
    Thanks,
    --Ed
  5. Ed
    Ed avatar
    168 posts
    Member since:
    Sep 2013

    Posted 01 Apr 2015 in reply to Iliana Nikolova Link to this post

    Hi Iliana,

    Actually, slightly different solution than I described earlier. I looked at options.series in my parse event and I see the information there properly, but then in the dataBound event, the options.series is empty. Could this be because I am getting the data remotely?  In any case, my solution (sort of a hack) in dataBound event was to check the data length and if zero, re-set the options.series to what is was originally.

    Do you have a better/cleaner/less hacky solution for me?

    Thanks,
    --Ed
  6. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2622 posts

    Posted 03 Apr 2015 Link to this post

    Hi Ed,

    If series.type is not specified the default "column" type will be applied. Hence in order to render a pie chart you need to set the type. 

    Regards,
    Iliana Nikolova
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top