This is a migrated thread and some comments may be shown as answers.

Fit shape width/height to text or fit text to shape width

3 Answers 183 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Leo
Top achievements
Rank 1
Leo asked on 10 Jun 2015, 01:18 PM
I can't seem to find any settings on how to make the shape auto-fit the content text or make the text auto size to fit the shape width.  Can you please explain how this can be done? 

3 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 12 Jun 2015, 03:09 PM
Hi Leo,

RadDiagram does not provide a built-in functionality to automatically wrap the text of a shape, or to transfer it to multiple lines. The only possible way to achieve a similar fnctionality for the moment is to use the RadDiagram Visual template functionality and add several Tex objects to a shape, so each of them will be rendered as a separate row. A live example of such implementation is available in the RadDiagram Overview demo:  http://demos.telerik.com/aspnet-ajax/diagram/examples/overview/defaultcs.aspx

Regards,
Vessy
Telerik
0
Anitha
Top achievements
Rank 1
answered on 23 Feb 2018, 06:05 AM

Hi Vassy,  is there a way to do it now in the Q1 2018 version of Telerik controls? 

 

Thank you!

0
Vessy
Telerik team
answered on 23 Feb 2018, 04:25 PM
Hi Anitha,

The discussed feature is still not available out-of-the-box in the diagram, but not the control provides an option to set  HTML content for its shapes, so you can achieve it easier.

For example:
<telerik:RadDiagram ID="RadDiagram1" runat="server">
    <ShapesCollection>
        <telerik:DiagramShape Id="s1" X="100" Y="100" Width="200">
            <ContentSettings Html="<div style='width:100px'>Long text content on multiple rows</div>" />
        </telerik:DiagramShape>
    </ShapesCollection>
</telerik:RadDiagram>


Regards,
Vessy
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Diagram
Asked by
Leo
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Anitha
Top achievements
Rank 1
Share this question
or