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

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

5 Answers 410 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 30 Mar 2015, 06:06 PM
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

5 Answers, 1 is accepted

Sort by
0
Accepted
Iliana Dyankova
Telerik team
answered on 01 Apr 2015, 08:14 AM
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!
 
0
Ed
Top achievements
Rank 1
answered on 01 Apr 2015, 04:21 PM
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
0
Ed
Top achievements
Rank 1
answered on 01 Apr 2015, 04:22 PM
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
0
Ed
Top achievements
Rank 1
answered on 01 Apr 2015, 04:49 PM
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
0
Iliana Dyankova
Telerik team
answered on 03 Apr 2015, 12:44 PM
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!
 
Tags
Charts
Asked by
Ed
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Ed
Top achievements
Rank 1
Share this question
or