How to make the content of the chart automatically fill the container without being blocked?

1 Answer 52 Views
Charts
Steve
Top achievements
Rank 1
Iron
Iron
Steve asked on 25 Apr 2023, 05:48 AM

As shown in the figure, when I use the Chart component, due to the large content of the label, some text on the top is blocked, but there is still a lot of space at the bottom, I wonder if there is any way to make it better displayed

1 Answer, 1 is accepted

Sort by
0
Filip
Telerik team
answered on 26 Apr 2023, 10:38 AM

Hi, Steve,

A possible approach would be to set a marginTop to the Chart in order to push it down. This can be achieved by using the style prop and passing the desired value for the top margin.

Here is an example that showcases this approach here:

https://stackblitz.com/edit/react-xo8dfq?file=app%2Fmain.jsx

I hope this helps.

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.

Steve
Top achievements
Rank 1
Iron
Iron
commented on 27 Apr 2023, 01:40 AM

Hi Philip,
   Thank you for your comment. But can't seem to fix it. Label content will be blocked when there are multiple lines or a lot of text. 

S54pe2 (forked) - StackBlitz

Thanks,
Steve


Filip
Telerik team
commented on 28 Apr 2023, 12:30 PM

Hello, Steve,

Thank you for the provided example.

I can recommend using the autoFit prop as it will scale down to fit the content area.

I updated the example here in order to showcase this approach:

https://stackblitz.com/edit/react-xo8dfq-vbha5d?file=app/main.jsx

Regards,

Filip

Tags
Charts
Asked by
Steve
Top achievements
Rank 1
Iron
Iron
Answers by
Filip
Telerik team
Share this question
or