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

Displaying chart legend as tooltip

2 Answers 84 Views
Chart
This is a migrated thread and some comments may be shown as answers.
SteveL
Top achievements
Rank 2
SteveL asked on 04 Aug 2009, 09:07 AM
Is it possible to have the legend for a chart appear as a tooltip for the chart, rather than being always displayed?

Steve

2 Answers, 1 is accepted

Sort by
0
Accepted
Giuseppe
Telerik team
answered on 05 Aug 2009, 08:03 AM
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.
0
SteveL
Top achievements
Rank 2
answered on 05 Aug 2009, 08:55 AM
Manuel,

Excellent! Thank you very much!

Steve
Tags
Chart
Asked by
SteveL
Top achievements
Rank 2
Answers by
Giuseppe
Telerik team
SteveL
Top achievements
Rank 2
Share this question
or