Pie Chart Drawing

TeeChart for ActiveX, COM and ASP
Post Reply
Raymond
Newbie
Newbie
Posts: 27
Joined: Tue Dec 02, 2008 12:00 am

Pie Chart Drawing

Post by Raymond » Mon Feb 01, 2010 11:03 pm

Hi,

I was looking at http://www.steema.com/uploads/gallery/PieExploded.png. The pie chart there looks a lot nicer and smoother than that I can draw. Is there a way to produce that kind of look?

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Pie Chart Drawing

Post by Yeray » Tue Feb 02, 2010 10:35 am

Hi raymond,

First of all notice that TeeChart ActiveX is a wrapper from the TeeChart VCL version. The charts in the pictures you refer were plotted using TeeChart for .NET and some of Microsoft .NET Framework drawing techniques are not available in the VCL framework.
On the other hand, find the code below written in VB6 that tries to obtain a pie chart with the ActiveX version as similar as possible to the .NET charts seen in the gallery.

Code: Select all

Private Sub Form_Load()
 With TChart1
   .ApplyPalette cpOpera
       With .Panel.Gradient
     .Visible = True
     .EndColor = RGB(225, 225, 225)
   End With

   With .Header
     .Text.Text = "Product Lines"
     .Font.Color = RGB(128, 128, 0)
     .Font.Size = 18
     .Alignment = taLeftJustify
   End With

   With .Legend
     .Alignment = laBottom
     .Transparent = True
     .Symbol.Shadow.Visible = False
   End With

   .AddSeries scPie
   With .Series(0)
     .FillSampleValues 5
     With .asPie
       .Shadow.Visible = False
       .PiePen.Visible = False
       With .Gradient
         .Visible = True
         .Direction = gdDiagonalDown
         .Balance = 30
       End With
       .PieMarks.LegSize = 50
       .ExplodeBiggest = 20
     End With
     With .Marks
       .Symbol.Visible = True
       .Symbol.Shadow.Color = clGrayText
       .Font.Size = 14
       .Shadow.Visible = False
       .Frame.Color = RGB(202, 164, 136)
       .Arrow.Color = RGB(216, 189, 169)
       .Transparency = 50
     End With
   End With

   .Tools.Add tcAntiAlias
 End With
End Sub 
Here is how it looks:
AX_Pie.png
AX_Pie.png (49.6 KiB) Viewed 7404 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Pie Chart Drawing

Post by Yeray » Tue Feb 02, 2010 12:16 pm

Hi raymond,

In addition to the above, I'd like you to know that we plan to add GDI+ to the next TeeChart ActiveX v9. This would improve the visual impact of these charts.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply