Hi,
After drawing a series (Polygon), I extracted (X,Y) positions but found there was a differece from the original value with about 0.05 in my case.
I used the following code:
void GetPolygonPoints(IMapPolygonPtr tPolygon, ITChartPtr Chart)
{
IPointArrayPtr vertexPts = tPolygon->GetPoints;
PointD vertPt(0.0,0.0);
for(int i=0; i<vertexPts->Count; i++)
{
vertPt.x = Chart->Axis->Bottom->CalcPosPoint((long)vertexPts->Item->GetX());
vertPt.y = Chart->Axis->Left->CalcPosPoint((long)vertexPts->Item->GetY());
}
}
Is this a known issue or did I do something wrong?
Or is this because I used Polygon?
Dongsu
CalcPosPoint Precision Error
Re: CalcPosPoint Precision Error
Hi Dongsu,
As you've seen, GetPoints gives you the points in pixels where they are drawn. If you want to convert a pixel into an axis value, there is a little error due to internal rounding. This is normal, and I can't think on a workaround for this right now.
On the other hand, in VCL the points in a polygon are accessible (Points.XValue, Points.YValue). I've added to the wish list the possibility to implement this feature in the ActiveX version too (TA05014934).
As you've seen, GetPoints gives you the points in pixels where they are drawn. If you want to convert a pixel into an axis value, there is a little error due to internal rounding. This is normal, and I can't think on a workaround for this right now.
On the other hand, in VCL the points in a polygon are accessible (Points.XValue, Points.YValue). I've added to the wish list the possibility to implement this feature in the ActiveX version too (TA05014934).
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: CalcPosPoint Precision Error
This is not good news. Indeed, I also have used TeeChart in VCL and was able to get non-rounded value.
That's why I tried to find functions in ActiveX as well.
Anyway, thank you.
Dongsu
That's why I tried to find functions in ActiveX as well.
Anyway, thank you.
Dongsu