I don't know the exact code, but I can give you an example in VB, that
could probably be converted into VB script for Excel. Basically, you
want to sweep a line around a circle, and plot the line length based
on amplitude. So;
midx = Me.Width / 2
midy = Me.Height / 2
'
radius = 0
'
For t = 0 To 359
'
radius = radius + 10
'
x = midx + Sin(t * (3.14159 / 180)) * radius
y = midy + Cos(t * (3.14159 / 180)) * radius
'
Me.Line (midx, midy)-(x, y), RGB(0, 0, 0)
'
Next
"Me" is the form in VB - whatever object you are going to be drawing
to - it needs to have some way to apply a "Line" statement, so that
you can draw a line. In this example, I am drawing a line from the
center of the form, spiralling it outward, changing the radius. In the
example, I am simply increasing the radius for every degree rotated -
you would need to plug in the method to retrieve the values from the
excel object (probably have to instantiate the excel object, load the
workbook, and read the values - I don't have the code in front of me
to do this right now, but there are examples on the net) indicating
the level of the reading (maybe multiplying by some amount to make
them "big" enough to graph).
This code should be easily convertable to Excel VB script, to pop open
a form and draw the graph. You would probably want to add extras
(maybe change the RGB value based on length to indicate strength,
perhaps add circles to represent distance strength from center for the
polar graph).
I hope this helps, or at least gives some insight. |