Click/touch on Datapoints in a chart

2 posts, 0 answers
  1. Nidhi
    Nidhi avatar
    19 posts
    Member since:
    Jun 2011

    Posted 15 Jun 2011 Link to this post

    HI Team,

    I have created a Line series chart. I want open another window on clicking if any datapoint. Manipulation started event is there. How can we know which Datapint is clicked.

  2. Georgi
    Georgi avatar
    296 posts

    Posted 16 Jun 2011 Link to this post

    Hello Nidhi,

    Thank you for your interest in RadControls for Windows Phone 7.

    In BETA 2 (expected within two weeks) we will introduce a PlotAreaTap event, which will give you the needed context - e.g. which is the closest data point, which is the series that contains it, etc.

    Currently you may perform your own loop and find the needed data point:

    protected override void OnManipulationStarted(ManipulationStartedEventArgs e)
        Point touchPoint = e.ManipulationOrigin;
        CategoricalSeries series = this.radChart1.Series[0] as CategoricalSeries;
        foreach (DataPoint dataPoint in series.DataPoints)
            RadRect layoutSlot = dataPoint.LayoutSlot;
            // check whether the layout slot of the point contains the touch point
            if (touchPoint.X >= layoutSlot.X && touchPoint.X <= layoutSlot.Right &&
                touchPoint.Y >= layoutSlot.Y && touchPoint.Y <= layoutSlot.Bottom)
                // data point is hit, perform some action

    I hope this information is useful. Should you have any other questions do not hesitate to contacts us.

    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. DevCraft banner
Back to Top