This is a migrated thread and some comments may be shown as answers.

Stacked Area Chart X and Y values.

3 Answers 125 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Manishkumar
Top achievements
Rank 1
Manishkumar asked on 19 Jan 2011, 02:33 PM
Hi,
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.

3 Answers, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 25 Jan 2011, 07:46 AM
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;
      }

Regards,
Evgenia
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Sivakumar
Top achievements
Rank 1
answered on 13 Aug 2012, 11:44 AM
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................
0
Petar Kirov
Telerik team
answered on 16 Aug 2012, 10:59 AM
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:RadChart.SeriesMappings>
                <telerik:SeriesMapping>
                    <telerik:SeriesMapping.SeriesDefinition>
                        <telerik:SplineRangeSeriesDefinition />
                    </telerik:SeriesMapping.SeriesDefinition>
                    <telerik:ItemMapping FieldName="Low" DataPointMember="Low" />
                    <telerik:ItemMapping FieldName="High" DataPointMember="High" />
                    <telerik:ItemMapping FieldName="Cat" DataPointMember="XCategory"/>
                </telerik:SeriesMapping>
            </telerik:RadChart.SeriesMappings>
        </telerik:RadChart>

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.

Tags
Chart
Asked by
Manishkumar
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Sivakumar
Top achievements
Rank 1
Petar Kirov
Telerik team
Share this question
or