Page 1 of 1
Pie Chart Drawing
Posted: Mon Feb 01, 2010 11:03 pm
by 15051059
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?
Re: Pie Chart Drawing
Posted: Tue Feb 02, 2010 10:35 am
by yeray
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 (49.6 KiB) Viewed 7465 times
Re: Pie Chart Drawing
Posted: Tue Feb 02, 2010 12:16 pm
by yeray
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.