Chart Legend Tooltip

9 posts, 0 answers
  1. pratik mehta
    pratik mehta avatar
    17 posts
    Member since:
    May 2010

    Posted 05 Aug 2010 Link to this post

    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
  2. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 10 Aug 2010 Link to this post

    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
  3. Developer Developer
    Developer Developer avatar
    8 posts
    Member since:
    Mar 2006

    Posted 19 Oct 2011 Link to this post

    Hi
    Is it possible to display a tooltip label instead of using MessageBox.Show?

    Regards
    Son
  4. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 20 Oct 2011 Link to this post

    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 >>

  5. Developer Developer
    Developer Developer avatar
    8 posts
    Member since:
    Mar 2006

    Posted 20 Oct 2011 Link to this post

    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
  6. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 21 Oct 2011 Link to this post

    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 >>

  7. Developer Developer
    Developer Developer avatar
    8 posts
    Member since:
    Mar 2006

    Posted 21 Oct 2011 Link to this post

    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
  8. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 25 Oct 2011 Link to this post

    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 >>

  9. Developer Developer
    Developer Developer avatar
    8 posts
    Member since:
    Mar 2006

    Posted 25 Oct 2011 Link to this post

    Thanks for help, i will submit a ticket for this.

    Regards
    Son
Back to Top