Is it possible to create a 1px line?

2 posts, 0 answers
  1. Andrew
    Andrew avatar
    18 posts
    Member since:
    Mar 2015

    Posted 30 Jan Link to this post

    Shapes seem to have a minimium width of 20px. Is it possible to have a line tool?
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3763 posts

    Posted 02 Feb Link to this post

    Hello Andrew,

    In the diagram lines are called connections. For example

    <telerik:RadDiagram ID="theDiagram" runat="server" Width="600px" Height="430px">
        <ShapesCollection>
            <telerik:DiagramShape Id="shape1" X="300" Y="20" Width="70" Height="70">
                <ContentSettings Text="Anna" Color="#fff" />
            </telerik:DiagramShape>
            <telerik:DiagramShape Id="shape2" X="400" Y="40" Width="120" Height="120">
                <ContentSettings Text="Rene" Color="#fff" />
            </telerik:DiagramShape>
        </ShapesCollection>
        <ConnectionsCollection>
            <telerik:DiagramConnection>
                <FromSettings ShapeId="shape1" />
                <ToSettings ShapeId="shape2" />
            </telerik:DiagramConnection>
        </ConnectionsCollection>
    </telerik:RadDiagram>

    You can see how to further customize their appearance here: http://demos.telerik.com/aspnet-ajax/diagram/examples/customizingelements/defaultcs.aspx.

    The shapes are not limited to 20px size, however, and you can reduce them further if you want, e.g.:

    <telerik:DiagramShape Id="shape1" X="300" Y="20" Width="10" Height="10">
        <ContentSettings Text="Anna" Color="#fff" />
    </telerik:DiagramShape>
    <telerik:DiagramShape Id="shape2" X="400" Y="40" Width="10" Height="10">
        <ContentSettings Text="Rene" Color="#fff" />
    </telerik:DiagramShape>

    An alternative would be to use the shape visuals and create your own shapes from scratch, as explained here: http://docs.telerik.com/devtools/aspnet-ajax/controls/diagram/functionality/shape-templates.

    Regards,

    Marin Bratanov
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top