Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Chart > how to find Line Chart Data items Active Region

Not answered how to find Line Chart Data items Active Region

Feed from this thread
  • kiran avatar

    Posted on Jun 26, 2008 (permalink)

    Hi Telerik Team,

    I am unable to find line chart data items active region points.(X,Y) values.
    i used the following code to find the active region.

    ChartSeriesItemsCollection

    items = radChart1.Series[1].Items;
    for (int i = 0; i < items.Count; i++)
    {
        MessageBox.Show(items[i].ActiveRegion.Region.GetLastPoint().X.ToString());
        MessageBox.Show(items[i].ActiveRegion.Region.GetLastPoint().Y.ToString());
    }

    Please help me out. i need these points X and Y values. Please share some sample application to get the active region points.

    Any help is highly appreciated.

    Regards,
    Kiran

    Reply

  • Dwight Dwight admin's avatar

    Posted on Jun 30, 2008 (permalink)

    Hi kiran,

    The items' ActiveRegion usually occupies a wider area than a single point. The easiest way to obtain a point is to retrieve the bounds of the region (which is a rectangular area) and get the center point:
    private List<Point> RetrieveSeriesPoints(ChartSeries series) 
        if (series == null
            return null
     
        List<Point> itemPoints = new List<Point>(); 
        foreach (ChartSeriesItem item in series.Items) 
        { 
            RectangleF regionBounds = item.ActiveRegion.Region.GetBounds(); 
            Point position = new Point((int)(regionBounds.Left + regionBounds.Width / 2), (int)(regionBounds.Top + regionBounds.Height / 2)); 
            itemPoints.Add(position); 
        } 
     
        return itemPoints; 

    All the best,
    Evtim
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Chart > how to find Line Chart Data items Active Region
Related resources for "how to find Line Chart Data items Active Region"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]