Stacked Area Chart X and Y values.

4 posts, 0 answers
  1. Manishkumar
    Manishkumar avatar
    240 posts
    Member since:
    Feb 2009

    Posted 19 Jan 2011 Link to this post

    Is it possible to get the X and Y values of the point, where user right clicked on the Stacked Area to open the context Menu?
    Or any nearby DataPoint  X,Y Values.

    Please Reply as soon as possible.

    Thanks in Advance.
  2. Evgenia
    Evgenia avatar
    1437 posts

    Posted 25 Jan 2011 Link to this post

    Hi Manishkumar,

    To be able to get the XValue and YValue of the right-clicked point you can use the following approach:
    GetPosition method of the System.Windows.Point struct will give you the Physical X and Y coordinates of the mose pointer poition. You can easily get the Data standing behind these values by using our Axis.ConvertPhysicalUnitsToData method:
    void ChartArea_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
              Point myPoint = e.GetPosition((UIElement)sender);
              double x = RadChart1.DefaultView.ChartArea.AxisX.ConvertPhysicalUnitsToData(myPoint.X) + RadChart1.DefaultView.ChartArea.AxisX.MinValue;
              double y = RadChart1.DefaultView.ChartArea.AxisY.ConvertPhysicalUnitsToData(myPoint.Y) + RadChart1.DefaultView.ChartArea.AxisY.MinValue;

    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. Sivakumar
    Sivakumar avatar
    2 posts
    Member since:
    Jul 2012

    Posted 13 Aug 2012 Link to this post

    How can assign x axis values to Spline Area chart, when i assign Low and High values, x axis always starts with 1,2,3.....

    but i don't want that to be happen, i have my own x-axis values , is it possible?

    Could you please help me................
  4. Petar Kirov
    Petar Kirov avatar
    425 posts

    Posted 16 Aug 2012 Link to this post

    Hi Manishkumar,

    I believe that you haven't bound the XValue of the series. Binding it should solve your issue. For example:

    <telerik:RadChart x:Name="RadChart1" ItemsSource="{Binding Data}">
                            <telerik:SplineRangeSeriesDefinition />
                        <telerik:ItemMapping FieldName="Low" DataPointMember="Low" />
                        <telerik:ItemMapping FieldName="High" DataPointMember="High" />
                        <telerik:ItemMapping FieldName="Cat" DataPointMember="XCategory"/>

    For more information on Series Mappings, you may refer to our documentation.

    I hope this helps.

    All the best,
    Petar Kirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top