Jump to content
Software FX Community

Adding ellipse to contour chart

User (Legacy)

Recommended Posts

Using ChartFx trail with VFP6.  I have a contour chart displaying in two 

dimensions with the value shown by colour and am trying to position and

size an ellipse on the chart.

First I can't attach to particular point/series coordinate. The .Attach

seems to respond to the first (X) index value but not the series (Y) index.

I've also tried attaching to the 3rd dimension (colour) value.

Secondly I've tried using .ValueToPixel and .Axis(AXIS_Y/X).PixPerUnit to

get the size of the ellipse to match the displayed coordinates and am not

having success. Please can someone point me in the right direction?

Link to comment
Share on other sites

I've tried things like:

lcPostnTxt = ALLTRIM(STR(lnAzim))+','+ALLTRIM(STR(lnElev))

loCircle.Attach (ATTACH_CENTER, lcPostnTxt)

lcPostnTxt = "5,9" where 5 is the value of the horizontal axis and 9 is the

value of the vertical axis.


lcPostnTxt = ALLTRIM(STR(lnAzim-lnMinX)) + ',' +



loCircle.Attach (ATTACH_CENTER, lcPostnTxt)

In this case lcPostnTxt = "15,11662"

lnCentreValue was the value of a point and 15 is the point index in the

series containing the 11662 value.

Where lnAzim & lnElev are numbers (integers in this case but not

necessarily). lnElev ranges from lnMinY to lnMaxY where each Y is a series

of points. lnAzim is a number between lnMinX and lnMaxX where lnMinX would

be the first point in each series. In the test case I have:

lnMinX = -10

lnMaxX = 10

lnMinY = 0

lnMaxY = 12

lnAzim = 5

lnElev = 9

Link to comment
Share on other sites

Ok. The problem here is that a the Attach method refers to logical X and Y

coordinates to be mapped to the X and Y axis respectively. In a contour

chart, there is no Y axis (the Y axis goes from "inside" the screen to the

observer), there is only X and Z.

There is no support for a Z axis in the annotation extension, so the attach

method is not going to work for you here.

The only API that can transform those X,Y,Z coordinates to X,Y coordinates

is MarkerToPixel (PaintInfo method, CPI_MARKERTOPIXEL constant). This method

allows you to determine the position of an specific point in the chart. You

will need to know what points you want to encircle with this ellipse.

If you explain to me exactly what are you trying to represent with this

ellipse I might be able to help you calculate its position.



Software FX, Inc.

Link to comment
Share on other sites


What we expected of the contour chart was the same kind of logic and

automatic axis scaling found on typical XY scatter charts. The lack of

support for the Z axis both on the contour chart and annotation is a


For the moment I am again back working on another project. I may get back

to you though!


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...