add series to polar plot

TeeChart for ActiveX, COM and ASP
Post Reply
Russ
Newbie
Newbie
Posts: 18
Joined: Thu Nov 02, 2006 12:00 am
Location: Chattanooga, TN
Contact:

add series to polar plot

Post by Russ » Fri Nov 17, 2006 1:58 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Nov 17, 2006 8:46 am

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
Best Regards,
Narcís Calvet / 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

Russ
Newbie
Newbie
Posts: 18
Joined: Thu Nov 02, 2006 12:00 am
Location: Chattanooga, TN
Contact:

re: add series to polar plot

Post by Russ » Fri Nov 17, 2006 3:25 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Nov 17, 2006 3:54 pm

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
Best Regards,
Narcís Calvet / 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

Russ
Newbie
Newbie
Posts: 18
Joined: Thu Nov 02, 2006 12:00 am
Location: Chattanooga, TN
Contact:

re: add series to polar plot

Post by Russ » Fri Nov 17, 2006 7:18 pm

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

Russ
Newbie
Newbie
Posts: 18
Joined: Thu Nov 02, 2006 12:00 am
Location: Chattanooga, TN
Contact:

Post by Russ » Sun Nov 19, 2006 3:03 am

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

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Nov 21, 2006 11:48 am

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.

Post Reply