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

RadDataBar: How to make the text fit at the end

2 Answers 79 Views
DataBar
This is a migrated thread and some comments may be shown as answers.
Shane
Top achievements
Rank 1
Shane asked on 23 Jul 2018, 12:54 AM

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 Answers, 1 is accepted

Sort by
0
Shane
Top achievements
Rank 1
answered on 23 Jul 2018, 12:57 AM

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

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)

0
Martin Ivanov
Telerik team
answered on 25 Jul 2018, 09:13 AM
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.
Tags
DataBar
Asked by
Shane
Top achievements
Rank 1
Answers by
Shane
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or