Display tooltip on XAxis

Thread is closed for posting
2 posts, 0 answers
  1. piro
    piro avatar
    6 posts
    Member since:
    Mar 2008

    Posted 13 Jul 2009 Link to this post

    I have a problem with display tooltip cho XAxis Item  need you help.
     
    I can  display tooltip  on  ChartSeriesItem with  command :
      ChartSeriesItem seriesItem = new ChartSeriesItem();
      seriesItem.ItemMap.ToolTip = "test";
     But i can't do this with XAxis item . I want  that, when i  click mouse over XAxit item, it will display full name of XAxit item.

    Please help me solve this problem . Thanks so much !
  2. Velin
    Admin
    Velin avatar
    391 posts

    Posted 16 Jul 2009 Link to this post

    Hi Piro,

    To attach tooltips to the XAxis items you should register for the RadChart BeforeLayout event. Here is a sample code:
    RadChart1.BeforeLayout += new EventHandler<EventArgs>(RadChart1_BeforeLayout); 
        void RadChart1_BeforeLayout(object sender, EventArgs e) 
        { 
            foreach (var item in RadChart1.PlotArea.XAxis.Items) 
            { 
                item.ActiveRegion.Tooltip = "Item " + RadChart1.PlotArea.XAxis.Items.IndexOf(item); 
            } 
        } 

    Hope this helps!

    Regards,
    Velin
    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.
Back to Top