Legend Items are missing...

2 posts, 0 answers
  1. Rob
    Rob avatar
    238 posts
    Member since:
    Jan 2009

    Posted 15 Oct 2012 Link to this post

    Hello,

    I have found a bug (I think) in the RadChart control...  For several months now, we have been using the RadChart like follows:
    <telerik:RadChart x:Name="RadChart" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4" telerik:AnimationManager.IsAnimationEnabled="False" ItemsSource="{TemplateBinding Items}" MinFullHeight="100" MinFullWidth="100" MaxWidth="425" MaxHeight="300" Style="{StaticResource rc_style}" Background="#FFFFFFFF" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
       <telerik:RadChart.DefaultView>
          <telerik:ChartDefaultView>
             <telerik:ChartDefaultView.ChartArea>
                <telerik:ChartArea>
                   <telerik:ChartArea.AnimationSettings>
                      <telerik:AnimationSettings ItemDelay="00:00:00.0" ItemAnimationDuration="00:00:00" />
                      </telerik:ChartArea.AnimationSettings>
                   </telerik:ChartArea>
                </telerik:ChartDefaultView.ChartArea>
             </telerik:ChartDefaultView>
          </telerik:RadChart.DefaultView>
    </telerik:RadChart>



    Recently, we noticed that the legend items were not showing...  After some trial and error, I discovered that removing the animcation settings fixed the problem...  Can you tell me why?  I don't recall exactly why we were setting the animationsettings in the first place, or else I would just remove it.
    <telerik:RadChart x:Name="RadChart" Style="{StaticResource rc_style}" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4" telerik:AnimationManager.IsAnimationEnabled="False" ItemsSource="{TemplateBinding Items}" MinFullHeight="100" MinFullWidth="100" MaxWidth="425" MaxHeight="300"  Background="#FFFFFFFF" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
    </telerik:RadChart>



    Please see the attached screenshot of "working" and "hidden" legend items...
  2. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 18 Oct 2012 Link to this post

    Hello Rob,

    The reason the ChartLegend is not displayed is actaully because by defining a ChartDefaultView, you are overriding the default one - which conatins a ChartLegend. As you can see in this help topic, when defining a ChartDefaultView, if you want a ChartLegend, you have to define one and also you have to tell the ChartArea to use is by setting its LegendName property.
     
    Kind regards,
    Petar Kirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top