RadDataBar: How to make the text fit at the end

3 posts, 0 answers
  1. Shane
    Shane avatar
    4 posts
    Member since:
    Mar 2018

    Posted 22 Jul 2018 Link to this post

    I need to get the fit of the maximum on the length of the control, either that or move the label below the line. 

    For the first option, I was thinking of reducing the value,and then customizing the labeltext that shows up. Only issue is, not sure how to modify the textblock that shows that value. 

    Second option, kind of related to the first one, how can I use a datatemplate to have a template where the label is below the line?

     

    Please refer to image attached.

     

    Thanks!

  2. Shane
    Shane avatar
    4 posts
    Member since:
    Mar 2018

    Posted 22 Jul 2018 Link to this post

    I need to get the fit of the maximum on the length of the control, either that or move the label below the line. 

    EDIT:

    I need the maximum bar label to fit the length of the control or move the label below the bar

    (Can't find the edit so I'm posting as a reply)

  3. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2065 posts

    Posted 25 Jul 2018 Link to this post

    Hello Shane,

    I am not sure that I understand what you mean by that you want the label to fit the length of the control. Can you elaborate a bit more on this case? Can you show me a picture with the current and the expected results?

    As for moving the label under the bar you can use the LabelStyle property of the control. Here is an example in code:
    <telerik:RadDataBar LabelPosition="Left">
        <telerik:RadDataBar.LabelStyle>
            <Style TargetType="TextBlock">
                <Setter Property="RenderTransform">
                    <Setter.Value>
                        <TranslateTransform X="0" Y="50" />
                    </Setter.Value>
                </Setter>
            </Style>
        </telerik:RadDataBar.LabelStyle>
    </telerik:RadDataBar>

    I hope that helps.

    Regards,
    Martin Ivanov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top