cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
djhanson
Level V

Draw Polygon on chart and get coordinates question

I have a bivariate chart with x/y coordinates. 

I can draw a polygon (which I think is Add Polygon Annotation) and then script the chart to find out the polygon's coordinates.  Problem is: they are not the coordinates of the chart's x/y axis.  Rather they seem to be coordinates of its polygon coordinate system, maybe like pixels or something like this.

Question: is there anyway to draw/freehand a polygon over a chart and get the polygon's coordinates in terms of those of the chart's x/y coordinate system?

 

thanks, DJ

1 REPLY 1
gzmorgan0
Super User (Alumni)

Re: Draw Polygon on chart and get coordinates question

@djhanson,

The graphic created by Add Polygon Annotation seems to be added to the PictureBox object and the values in the save script are units of pixels. An approximation of the X and Y coordinates can possibly be made by:

  • getting the pixels of the polygon
  • getting the size of the PictureBox
  • getting the size of each AxisBox, and maybe the FrameBox
  • getting each axis's settings (Min, Max, Inc)
  • compute the relative values.

That said, once I calculated that, I would remove the Polygon Annotation and add a graphics script to the FrameBox that draws a polygon using the approximated coordinates. 

 

Other methods would be to add a button to the report that draws an editable polygon. This would require callback functions using a MouseBox or Handle or something like that. There are other call back methods that I can imagine.

 

I don't have time at the moment to take a stab at either method. But maybe another community member has a solution.

 

It would be useful to know how you intend to use these coodinates.