sanjin
asked on 15 Mar 2022, 02:49 PM
| edited on 15 Mar 2022, 06:29 PM
Hi!
I get Uncaught TypeError: Cannot read properties of undefined (reading 'bbox') when i want to save pie and donut as pdf in javascript but all other charts works fine what can the problem be?
Regards Sanjin
2 Answers, 1 is accepted
1
Accepted
Patrick | Technical Support Engineer, Senior
Telerik team
answered on 18 Mar 2022, 09:32 PM
Hello Sanjin,
First, thank you for providing the Progress Kendo UI Dojo as this helped determine the cause of the bbox error message.
Upon reviewing the onRender method, it appears at the end there's a label attempting to be added to a group. For the Pie and Donut charts which do not have this line available, the error occurs. To resolve this issue, conditionally check if the chart is not a pie or donut chart:
JavaScript
// ritar målvärde per diagramfunctiononRender(e) {
//.....
group = new kendo.drawing.Group();
//Confirms the type is not a donut or pieif (e.sender.options.series[0].type != 'donut' && e.sender.options.series[0].type != 'pie' ){
//Will add line
group.append(line, label);
}
// Draw on chart surface//// https://docs.telerik.com/kendo-ui/framework/drawing/overview
e.sender.surface.draw(group);
}
Additionally, please make sure there is only one version of Kendo UI to make sure there are no conflicts with code. I have created an updated Progress Kendo UI Dojo which demonstrates the above and allows the user to export to PDF the donut and pie charts. Please let me know if you have any questions.
Regards,
Patrick | Technical Support Engineer, Senior
Progress Telerik
The Kendo UI Pie and Donut Chart PDF export is working as expected as described in the Saving Chart in PDF article. Here is the StackBlitz example of the Pie Chart demonstrating the same.
Additionally, both the Pie Chart and the Donut Chart can be exported in the same PDF by using the PDF Export component. In this StackBlitz example, I have exported both the Pie Chart and the Donut Chart in the PDF.
To further assist you with this case, could you please update the StackBlitz example or share an isolated Angular application with additional details such that it replicates the error observed on your end?
I also recommend sharing a Fiddler Jam recording which can capture the logs and help me with the investigation.
Hi Hetali, i'm not using Angular i'm using jQery but i send you code in the dojo and you can look, i have only problem whit the PDF for the Pie and Donut chart Untitled | Kendo UI Dojo (telerik.com)