Displaying chart legend as tooltip

3 posts, 1 answers
  1. SteveL
    SteveL avatar
    68 posts
    Member since:
    Apr 2009

    Posted 04 Aug 2009 Link to this post

    Is it possible to have the legend for a chart appear as a tooltip for the chart, rather than being always displayed?

    Steve
  2. Answer
    Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 05 Aug 2009 Link to this post

    Hello Steve,

    You can achieve the desired effect like this:

    XAML
    <telerik:RadChart x:Name="RadChart1"
        <telerik:RadChart.ToolTip> 
            <ToolTip Background="Black"
                <ToolTip.Content> 
                    <chart:ChartLegend x:Name="TooltipLegend" Background="Black" Height="300" Width="200" /> 
                </ToolTip.Content> 
            </ToolTip> 
        </telerik:RadChart.ToolTip> 
    </telerik:RadChart> 

    C#
    this.RadChart1.DefaultView.ChartLegend.Visibility = System.Windows.Visibility.Collapsed; 
    this.RadChart1.DefaultView.ChartArea.Legend = this.FindName("TooltipLegend"as ChartLegend; 
    this.RadChart1.ItemsSource = new[] {1, 2, 3, 4, 5, 6}; 



    Regards,
    Manuel
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for WPF is Visual Studio 2017 Ready
  4. SteveL
    SteveL avatar
    68 posts
    Member since:
    Apr 2009

    Posted 05 Aug 2009 Link to this post

    Manuel,

    Excellent! Thank you very much!

    Steve
Back to Top