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

Chart Legend Tooltip

8 Answers 142 Views
Chart
This is a migrated thread and some comments may be shown as answers.
pratik mehta
Top achievements
Rank 1
pratik mehta asked on 05 Aug 2010, 08:50 AM
Hi,

Is it possible to show custom template on Legend item  mouse hover?Basically iwant to display some detail about series on Legend Mouse Hover.


Thanks

Pratik Mehta

8 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 10 Aug 2010, 07:18 AM
Hello pratik,

One possible option in this case would be to get a reference to the item(s) in the legend, and set a mouse over handler:

telerikChart.DefaultView.ChartLegend.Items[0].MouseEnter += new MouseEventHandler(MainPage_MouseEnter);
         
        void MainPage_MouseEnter(object sender, MouseEventArgs e)
        {
            MessageBox.Show("Mouse over element");
        }

I hope this gets you started properly.

Regards,
Yavor
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Developer Developer
Top achievements
Rank 1
answered on 19 Oct 2011, 02:36 PM
Hi
Is it possible to display a tooltip label instead of using MessageBox.Show?

Regards
Son
0
Yavor
Telerik team
answered on 20 Oct 2011, 07:54 AM
Hello,

You can have the tooltip preset over the item:

http://www.silverlightshow.net/items/Using-the-ToolTip-control-in-Silverlight-2.aspx

The other option is to dynamically create a tooltip and hide/show it:

ToolTip tt = new ToolTip();
            tt.Content = "test";
            tt.IsOpen = true;

I hope this gets you started properly.

Greetings,
Yavor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Developer Developer
Top achievements
Rank 1
answered on 20 Oct 2011, 11:26 AM
Thanks for tips Yavor,
I have populated a chart programatically and used Data Binding to Nested Collections (1-n dataseries), but can't get access to the
dataitem when hovering the mouse over a datapoint. I can only display the datapoint values, the dataitem is always null.
Is this a bug in in Telerik Chart controller?

Son
0
Yavor
Telerik team
answered on 21 Oct 2011, 07:43 AM
Hi,

In which event are you handling the functionality? Any additional information will be helpful.

Kind regards,
Yavor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Developer Developer
Top achievements
Rank 1
answered on 21 Oct 2011, 09:04 AM
Hi Yavor,
I have tried to retrieve the value with two alternatives:
1. Setting the ItemToolTipFormat: currentMapping.SeriesDefinition.ItemToolTipFormat = "Time:#DATAITEM.TimeStamp"
2. Handling the event ItemToolTipOpening to override the tooltip.

        private void ChartArea_ItemToolTipOpening(Telerik.Windows.Controls.Charting.ItemToolTip2D tooltip, Telerik.Windows.Controls.Charting.ItemToolTipEventArgs e)
        {
            var graphDataPoint = e.DataPoint.DataItem as GraphDataPointDTO;
            tooltip.Content = string.Format("Time:{0}", graphDataPoint.TimeStamp);
        }


On both cases the DATAITEM is null, only the datapoint has values.

Son
0
Yavor
Telerik team
answered on 25 Oct 2011, 01:35 PM
Hi,

I made a small test, and the datapoint was accessible. If the issue persists at your end, you can open a formal support ticket, and send us a small working project, demonstrating the discrepancy, for additional review and testing.

Best wishes, Yavor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Developer Developer
Top achievements
Rank 1
answered on 25 Oct 2011, 02:20 PM
Thanks for help, i will submit a ticket for this.

Regards
Son
Tags
Chart
Asked by
pratik mehta
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Developer Developer
Top achievements
Rank 1
Share this question
or