Page 1 of 1

access polygon x,y values

Posted: Mon Jul 11, 2011 3:47 pm
by 15056076
is there a way to access polygon x,y values using visual foxpro. The VB code example does not work

Any ideas

Re: access polygon x,y values

Posted: Tue Jul 12, 2011 9:07 am
by 15056076
I can access all the polygon() properties except getpoints

which in the VB code works ok. Does anyone know how to get round this problem.

Thanks

Re: access polygon x,y values

Posted: Tue Jul 12, 2011 9:45 am
by 10050769
Hello syren,

Can you explain exactly that you refer when you talk about polygon, so we can try to find a good solution of your problem? And also, I recommend you that take a look in Demo examples are included in TeeChartActivex build as you can find in: ...\TeeChart Pro v2010 ActiveX Control\Examples\Visual FoxPro.

Thanks,

Re: access polygon x,y values

Posted: Tue Jul 12, 2011 9:58 am
by 15056076
Hi Sandra, Im using V8 activex

This is the code:
Creating the map:

FOR lnVertCount=thisform.oleShapeFile.Parts(lnThisPart).Begins TO thisform.oleShapeFile.Parts(lnThisPart).Ends
lnNoParts=thisform.oleShapeFile.Vertices(lnVertCount).PartNo
lnXCord=thisform.oleShapeFile.Vertices(lnVertCount).X_Cord
lnYCord=thisform.oleShapeFile.Vertices(lnVertCount).Y_Cord
lnZCord=thisform.oleShapeFile.Vertices(lnVertCount).Z_Cord
lnMeasure=thisform.oleShapeFile.Vertices(lnVertCount).Measure
thisform.oleChart.series(0).asMap.Shapes.Polygon(lnPolygon).Color=lnSeries0
thisform.oleChart.series(0).asMap.Shapes.Polygon(lnPolygon).Gradient.Visible=.T.
thisform.oleChart.series(0).asMap.Shapes.Polygon(lnPolygon).AddXY(lnXCord,lnYCord) && tmpPoints(i).X, tmpPoints(i).Y
thisform.oleChart.series(0).asMap.Shapes.Polygon(lnPolygon).Closed=.T.
NEXT

trying to read the created map:

FOR ln=0 TO lnPolygonCount
loShape=thisform.oleChart.Series(0).asMap.Shapes.Polygon(ln)
thisform.cntProgress.oleprogress.value=ln
IF loShape.Visible THEN
lcShape=UPPER(ALLTRIM(loShape.Text))
lnPolyIndex=loShape.index
lbState=loShape.closed
DIMENSION laPoints(10,2)
laPoints=loShape.getpoints(lnPolyIndex) - this fails
loShape.Color=lnColour
loShape.Gradient.Visible=.F.
ENDIF
NEXT

Re: access polygon x,y values

Posted: Tue Jul 12, 2011 12:26 pm
by 15056076
Hi Sandra, unfortunately the examples do not cover the map drawing so do not give me any clues.

Thanks

Re: access polygon x,y values

Posted: Wed Jul 13, 2011 11:56 am
by 10050769
Hello syren,

I have made a simple code that works fine for me. I have use next lines of code and Visual Studio FoxPro :

Code: Select all

Form1.OleControl1.Series(0).FillSampleValues()
Form1.OleControl1.Series(0).asMap.Shapes.Polygon(0).AddXY(0,4.99)
Form1.OleControl1.Series(0).asMap.Shapes.Polygon(0).AddXY(0,5.12)
Form1.OleControl1.Series(0).asMap.Shapes.Polygon(0).AddXY( 0,5.23)
Form1.OleControl1.Series(0).asMap.Shapes.Polygon(0).AddXY(0,5.1)
As you see in previous code you need add values previously to access in the Shapes.Polygon(0) points. Can you confirm, us if previous code works as you expected?

I hope will helps.

Thanks,

Re: access polygon x,y values

Posted: Wed Jul 13, 2011 3:57 pm
by 15056076
Hi Sandra, I am adding using addXY and the polygons are being drawn. But a cannot read the points back from the polygon shape. I can read its text, color and visible state but not the points or count.

Or are you saying i must issue a fillsamplevalues before doing the addxy

Thanks
Andrew

Re: access polygon x,y values

Posted: Thu Jul 14, 2011 8:33 am
by 15056076
Hi Sandra, the code that allows me to add polygon is:

Form1.OleControl1.Series(0).FillSampleValues()
lnPolygon=Form1.OleControl1.Series(0).asMap.Shapes.Add
Form1.OleControl1.Series(0).asMap.Shapes.Polygon(lnPolygon).AddXY(0,4.99)

without line 2 the code will error.

if I execute:
lnX=Form1.OleControl1.Series(0).asMap.Shapes.Polygon(lnPolygon).GetPoints.Item.X

I get an ole error

Re: access polygon x,y values

Posted: Thu Jul 14, 2011 3:13 pm
by 10050769
Hello syren,

I inform you that we have been investigating why in next line of code, appears an error when you try to execute it:

Code: Select all

lnX=Form1.OleControl1.Series(0).asMap.Shapes.Polygon(lnPolygon).GetPoints.Item.X  
We will try to inform you asap about problem.

Thanks,

Re: access polygon x,y values

Posted: Thu Jul 21, 2011 6:09 am
by 15056076
Does the 2010 version fix this or do you have a work around yet.

Many Thanks
Andrew

Re: access polygon x,y values

Posted: Wed Jul 27, 2011 12:29 pm
by 10050769
Hello syren,

Sorry for the delay. We have done many test and we have considered it as a bug. I have added it in bug list report with number (TA05015674) to be try fix it for next maintenance releases of TeeChartActivex.On the other hand,I recommend you to be aware at this forum, our RSS news feed, twitter and facebook accounts for new release announcements and what's implemented on them.

Thanks,