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

Chart redraw fails if grouped datasource returns zero items

3 Answers 55 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 12 Feb 2013, 08:38 PM
Hi,

I have chart that shows the temperature data of a bunch of showers. The DataSource that supplies this data groups the data by the ShowerId. The problem occurs when none of the checkboxes are checked (no data will be shown). The DataSource will hence return no data and the Chart._onDataChanged will crash on the line:

categoriesData = grouped ? data[0].items : data

I have temporarly solved this by overwriting the line in the _dataChangeHandler/_onDataChanged to

categoriesData = grouped && typeof data[0] === "object" ? data[0].items : data

It's not the best solution, but it gets the job done for my situation. I have had similar problems with empty grouped datasources in the past, so I wonder if you could possibly provide a fix in a future update which will still create the grouped objects (even if received data array is empty), but just with an empty items array and value? Or is there a certain reason these are not created if no data is received?

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 15 Feb 2013, 12:45 PM
Hello Dennis,

Thank you for bringing our attention to this problem. I reproduced it on my side and we have made the needed changes. The fix will be available in the next internal builds and official releases. I updated your Telerik points for the involvement.

Regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ina
Top achievements
Rank 1
answered on 14 Jul 2015, 01:48 PM
Chart redraw fails if parent container of chart container has a float style defined (left/right)
0
Daniel
Telerik team
answered on 16 Jul 2015, 09:50 AM
Hello,

Could you provide a runnable sample that demonstrate the issue? The chart seems to be working correctly in this scenario at least on my side.

Regards,
Daniel
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
Dennis
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Ina
Top achievements
Rank 1
Share this question
or