Legend is not aligned correctly

3 posts, 0 answers
  1. ardmore
    ardmore avatar
    28 posts
    Member since:
    Jul 2016

    Posted 13 Nov 2017 Link to this post

    I use RadLegend control for my RadChart. Here is my xaml code. However it is not aligning correctly. See the attached image.

            <Path Width="15" Height="15" Fill="{Binding MarkerFill}"
                          HorizontalAlignment="Left" Grid.Column="0">
                            <Binding Path="ActualMarkerGeometry"
                                 RelativeSource="{RelativeSource AncestorType=telerik:LegendItemControl}">
                 <TextBlock Text="{Binding Title}" Foreground="White" Margin="15 0 0 0" HorizontalAlignment="Left" Grid.Column="1" />
  2. Sia
    Sia avatar
    745 posts

    Posted 14 Nov 2017 Link to this post


    The layout depends on the grid and its columns. Thats is why I would suggest
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition />

    However I am not sure what could cause the TextBlocks' right alignment. That is why I would appreciate a sample project showing the settings of your project.

    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.
  3. ardmore
    ardmore avatar
    28 posts
    Member since:
    Jul 2016

    Posted 14 Nov 2017 in reply to Sia Link to this post

    For some reason I can't upload a sample project, but I find the issue. You have to define the width of the column a fixed value.

        <ColumnDefinition Width="50" />
        <ColumnDefinition  Width="100"/>

    Using Auto is not working. Maybe it is a bug of RadLegend control.


Back to Top