access polygon x,y values

TeeChart for ActiveX, COM and ASP
Post Reply
syren
Newbie
Newbie
Posts: 7
Joined: Mon May 03, 2010 12:00 am

access polygon x,y values

Post by syren » Mon Jul 11, 2011 3:47 pm

is there a way to access polygon x,y values using visual foxpro. The VB code example does not work

Any ideas

syren
Newbie
Newbie
Posts: 7
Joined: Mon May 03, 2010 12:00 am

Re: access polygon x,y values

Post by syren » Tue Jul 12, 2011 9:07 am

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

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: access polygon x,y values

Post by Sandra » Tue Jul 12, 2011 9:45 am

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

syren
Newbie
Newbie
Posts: 7
Joined: Mon May 03, 2010 12:00 am

Re: access polygon x,y values

Post by syren » Tue Jul 12, 2011 9:58 am

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

syren
Newbie
Newbie
Posts: 7
Joined: Mon May 03, 2010 12:00 am

Re: access polygon x,y values

Post by syren » Tue Jul 12, 2011 12:26 pm

Hi Sandra, unfortunately the examples do not cover the map drawing so do not give me any clues.

Thanks

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: access polygon x,y values

Post by Sandra » Wed Jul 13, 2011 11:56 am

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

syren
Newbie
Newbie
Posts: 7
Joined: Mon May 03, 2010 12:00 am

Re: access polygon x,y values

Post by syren » Wed Jul 13, 2011 3:57 pm

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

syren
Newbie
Newbie
Posts: 7
Joined: Mon May 03, 2010 12:00 am

Re: access polygon x,y values

Post by syren » Thu Jul 14, 2011 8:33 am

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

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: access polygon x,y values

Post by Sandra » Thu Jul 14, 2011 3:13 pm

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

syren
Newbie
Newbie
Posts: 7
Joined: Mon May 03, 2010 12:00 am

Re: access polygon x,y values

Post by syren » Thu Jul 21, 2011 6:09 am

Does the 2010 version fix this or do you have a work around yet.

Many Thanks
Andrew

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: access polygon x,y values

Post by Sandra » Wed Jul 27, 2011 12:29 pm

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply