Exported image does not scale chart content to fit the specified dimensions

1 Answer 9 Views
Charts General Discussions
Ling
Top achievements
Rank 1
Iron
Ling asked on 12 May 2025, 03:06 AM
Hi Kendo Team,

I'm using the exportVisual and exportImage APIs to export a chart to a PNG file in my React application. I expected that setting a larger width and height in the exportImage options would result in a proportionally scaled-up chart. However, while the output image has the correct dimensions (e.g., 1920x1080), the chart content itself does not scale up — it stays small in the top-left corner and does not fill the canvas.

It seems that the exportImage function does not automatically scale the chart visual to match the specified output size.


Please let me know if this is the intended behavior or if there's a simpler way to scale the visual.

Thanks!
Dbcojf8y (forked) - StackBlitz

1 Answer, 1 is accepted

Sort by
0
Filip
Telerik team
answered on 13 May 2025, 01:47 PM

Hi, Ling,

The behavior you are experiencing with the exportImage API is indeed intended. When exporting a chart, the visual content does not automatically scale to fit the specified dimensions; instead, it retains its original size within the larger canvas. 

I can suggest programmatically adjusting the chart's width and height to match the desired export dimensions before calling the export function. I have created an example which showcases this approach here:

Please review the approach used above and let me know in case this is not exactly what you are looking for and I will gladly assist further.

Regards,
Filip
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Ling
Top achievements
Rank 1
Iron
commented on 16 May 2025, 07:14 AM

Thanks very much for your quick and detailed response. The proposed solution looks feasible and aligns well with our needs.

Thanks again for your help!
Filip
Telerik team
commented on 19 May 2025, 10:00 AM

Hi, Ling,

I am glad to hear that the proposed solution aligns with your needs. Let me know in case further assistance is required.

Regards,
Filip
Tags
Charts General Discussions
Asked by
Ling
Top achievements
Rank 1
Iron
Answers by
Filip
Telerik team
Share this question
or