I use the sidebar toggle but why does the kendo reaction chart always break or leave a space if the sidebar is enabled or closed

1 Answer 206 Views
Charts
Noor
Top achievements
Rank 1
Iron
Noor asked on 21 Mar 2022, 05:17 AM

I use the sidebar toggle but why does the kendo reaction chart always break or leave a space if the sidebar is enabled or closed

please give me a solution or code sample

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 21 Mar 2022, 06:11 AM

Hi Noor,

Could you please provide more information about the exact configuration that you have and if possible, share an example demonstrating the issue, so we can test it on our end and suggest a solution for it.

Looking forward to your reply.

 

Regards,
Konstantin Dikov
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.

Noor
Top achievements
Rank 1
Iron
commented on 21 Mar 2022, 06:34 AM

okay, so the case is I have a sidebar trigger where the sidebar component is created in another project or another repo (microfrontend), why if the sidebar is closed on the chart in kendo react chart it is cut off or leaves a space?

and this is an example of a truncated chart section

Konstantin Dikov
Telerik team
commented on 21 Mar 2022, 06:21 PM

Hi Noor,

It seems that when the sidebar is collapsed, the two elements holding the Charts are expanded, which means that the initial width of the Chart components will be less that the new width of the containers.

This behavior can be observed in the following example if you click on the button:

In order to resolve this, you can trigger the "resize" event of the "window" object, which will force the Chart to redraw:

const onClick = (ev) => {
    mainDiv.current.style.width = '500px';
    window.dispatchEvent(new Event('resize'));
  };

In your scenario, you can trigger the event after the sidebar is collapsed.

Hope this helps.

 

Tags
Charts
Asked by
Noor
Top achievements
Rank 1
Iron
Answers by
Konstantin Dikov
Telerik team
Share this question
or