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

Error with ConvertPhysicalUnitsToData

3 Answers 59 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Adrien Pellegrini
Top achievements
Rank 1
Adrien Pellegrini asked on 17 Apr 2011, 02:10 PM
Hello,

I try to get the corresponding value from a Point but the result of the ConvertPhysicalUnitsToData is not correct.

This was my first attempt:
Double startX = chart.DefaultView.ChartArea.AxisX.ConvertPhysicalUnitsToData(e.XValue);

The startX variable is not correct. Now if I substract 50 to XValue I got the correct value.

Double startX = chart.DefaultView.ChartArea.AxisX.ConvertPhysicalUnitsToData(e.XValue - 50);

50 is the gap between the left side of the RadChart and the beginning of the chart area. If I add a Title on the AxisY, I must substract 81 ...

Why ConvertPhysicalUnitsToData doesn't return the right value?


Regards,
Adrien Pellegrini.

3 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 20 Apr 2011, 09:33 AM
Hi Adrien Pellegrini,

ConvertPhysicalUnitsToData should display the exact DataPoint, whereas ConvertDataUnitsToPhysical should return the distance in pixels. Perhaps this is the misunderstanding in this case.

Please, find attached a sample application, which makes use of ConvertPhysicalUnitsToData and works as expected on our side. Could you, please, have a look at it and if the problems you've experienced persist, we would ask you to provide more details on your specific scenario and modify the application, so that it reproduces the issue.

You may also find this blogpost useful. Hope this helps.

All the best,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Adrien Pellegrini
Top achievements
Rank 1
answered on 29 Apr 2011, 07:58 AM
I can't test your example since I'm not writing my code in a tooltipOpening event.

The code I wrote is in a PlotAreaMouseLeftButtonDown event and we don't have access to a MouseData object. We got directly the X and Y value which are wrong ...
0
Nikolay
Telerik team
answered on 04 May 2011, 08:02 AM
Hi Adrien Pellegrini,

Could you, please, open a support ticket and send us a sample runnable application ( or modify the one we have sent ) that demonstrates the issue you've encountered with ConvertPhysicalUnitsToData, so that our developers could debug it and provide further support.

All the best,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart
Asked by
Adrien Pellegrini
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Adrien Pellegrini
Top achievements
Rank 1
Share this question
or