Text Wrap Category Labels

1 Answer 52 Views
Charts
Karalynn
Top achievements
Rank 1
Karalynn asked on 07 Jun 2023, 07:08 PM

I'm trying to find a way to be able to wrap the text of a category label if it exceeds a certain character limit. For example,

"This really long category label"

would become

"This really
long category
label" 

if it were limited to 15 characters per line.  Is there a way to do this either with the default label or with a custom renderer?

1 Answer, 1 is accepted

Sort by
1
Accepted
Vessy
Telerik team
answered on 08 Jun 2023, 02:23 PM

Hi, Karalynn,

You can achieve the desired text-wrapping functionality by utilizing the labels `content()` funtionality of the CategoryAxis. In the following sample we are splitting the  passed label in multiple rows based on the passed max characters value:

Regards,
Vessy
Progress Telerik

As of R2 2023, the default icon type will be SVG instead of Font. See this blogpost for more information.
Tags
Charts
Asked by
Karalynn
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or