Page 1 of 1

add series to polar plot

Posted: Fri Nov 17, 2006 1:58 am
by 9532946
I have a series of polar data points that I want to add to a polar plot. How do I do this in VB 6.0 code?

The data points are:
Magnitude Phase angle
----------- -------------
15.6 45 degrees
18.2 120 degrees
5.4 -12 degrees

thanks,
russ

Posted: Fri Nov 17, 2006 8:46 am
by narcis
Hi Russ,

You need to populate polar series like this:

Code: Select all

    With TChart1.Series(0).asPolar
        .AddPolar 45, 15.6, "", clTeeColor
        .AddPolar 120, 18.2, "", clTeeColor
        .AddPolar 12, 5.4, "", clTeeColor
    End With

re: add series to polar plot

Posted: Fri Nov 17, 2006 3:25 pm
by 9532946
Narcis: Thank you very much. I have additional question. How can I make the end point of each vector on the polar plot be an arrow head? Like hands on a clock where the end is an arrowhead.

Best Regards,
russ

Posted: Fri Nov 17, 2006 3:54 pm
by narcis
Hi Russ,

Yes, you can do this using the OnGetSeriesPointerStyle event as shown here:

Code: Select all

Dim EndVector As Integer

Private Sub Form_Load()
    With TChart1.Series(0).asPolar
        .AddPolar 45, 15.6, "", clTeeColor
        .AddPolar 120, 18.2, "", clTeeColor
        EndVector = .AddPolar(12, 5.4, "", clTeeColor)
    End With
End Sub

Private Sub TChart1_OnGetSeriesPointerStyle(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, AStyle As TeeChart.EPointerStyle)
    If ((SeriesIndex = 0) And (ValueIndex = EndVector)) Then
        AStyle = psDownTriangle
    Else
        AStyle = psNothing
    End If
End Sub

re: add series to polar plot

Posted: Fri Nov 17, 2006 7:18 pm
by 9532946
Narcis: Thanks for all your help.

How can I plot these so that each is plotted as a radial vector from the origin? Similar to what is shown in the attached picture below (hope i built the link properly below).

Best Regards,
russ

Image

Posted: Sun Nov 19, 2006 3:03 am
by 9532946
I figured out how to make radial vectors from the origin.

But, I don't see a good solution to having arrow-head ends of these vectors - not one that looks good. This might be a good enhancement for later release?

Best Regards,
russ

Posted: Tue Nov 21, 2006 11:48 am
by Pep
Hi russ,

the only way I can think of to do this would be to manually calculate each end bar position of the polar and draw the arrow-header directly on the canvas, using :

Code: Select all

Private Sub TChart1_OnSeriesAfterDrawValues(ByVal SeriesIndex As Long)
TChart1.Canvas.TriangleWithZ 10, 10, 20, 10, 15, 15, 0
End Sub
I've added this feature on our wish list (allow to draw arrow-headers with correct rotation), it will be considered to inclusion for the next releases.