Drill-Down - More than one DataSeries

3 posts, 1 answers
  1. Nuno
    Nuno avatar
    6 posts
    Member since:
    Sep 2012

    Posted 09 Sep 2012 Link to this post

    Hi,
    I'm using Radchart with more than one DataSeries.
    The problem i have is that i'm not being able to know the exact DataSeries that was clicked.
    On the image, you can see an example
    When i click on the first blue column i'm getting the same object i get when i click on the first red collumn.
    How is it possible to distinct both columns on the ItemClick Event?


  2. Answer
    Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 12 Sep 2012 Link to this post

    Hi Nuno ,

    The event handler for the ItemClick has ChartItemClickEventArgs which can give you information about the exact data point you have clicked and DataSeries to which the data point belongs.

    You could check if the data series of the data point are the same as those at index x in radChart.DefaultView.ChartArea.DataSeries collection. Like this: 
    if (e.DataPoint.DataSeries == this.radChart.DefaultView.ChartArea.DataSeries[0])
    {
        //...
    }
    else
    {
        //...
    }

    Or if that is not enough (or you are using item mappings) you could set each data series a different LegendLabel and distinguish the data series by it:
    if (e.DataPoint.DataSeries.LegendLabel == "Series 1")
    {
    }
    else if (...)
    {
    }

    I hope this helps.
     
    Regards,
    Petar Kirov
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  3. DevCraft banner
  4. Nuno
    Nuno avatar
    6 posts
    Member since:
    Sep 2012

    Posted 13 Sep 2012 Link to this post

    Thanks Petar,
    The first solution solved my problem.
Back to Top