1

I have a DBChart with 5 PieSerie on it. Notice how the last pie is truncated. Is there something I can do to avoid the situation? I'm using TeeChart Standard v2011.03.32815 VCL; and apart from changing the color theme, I haven't changed any property of the charts. When 5 charts are drawn together When only the chart in question is visible

Here is the DFM of the frame which contains the DBChart

object frmAdminStats: TfrmAdminStats
  Left = 0
  Top = 0
  Width = 730
  Height = 610
  BiDiMode = bdRightToLeft
  DoubleBuffered = True
  ParentBiDiMode = False
  ParentDoubleBuffered = False
  TabOrder = 0
  object DBChart1: TDBChart
    Left = 0
    Top = 0
    Width = 730
    Height = 610
    AllowPanning = pmNone
    Foot.Font.Name = 'Tahoma'
    SubFoot.Font.Name = 'Tahoma'
    SubTitle.Font.Name = 'Tahoma'
    Title.Font.Name = 'Tahoma'
    Title.Text.Strings = (
      '')
    Title.Visible = False
    BottomAxis.LabelsFont.Name = 'Tahoma'
    BottomAxis.Title.Font.Name = 'Tahoma'
    DepthAxis.LabelsFont.Name = 'Tahoma'
    DepthAxis.Title.Font.Name = 'Tahoma'
    DepthTopAxis.LabelsFont.Name = 'Tahoma'
    DepthTopAxis.Title.Font.Name = 'Tahoma'
    LeftAxis.LabelsFont.Name = 'Tahoma'
    LeftAxis.Title.Font.Name = 'Tahoma'
    Legend.Font.Name = 'Tahoma'
    Legend.ResizeChart = False
    Legend.TextStyle = ltsPlain
    Legend.Title.Font.Name = 'Tahoma'
    Legend.Transparent = True
    Legend.Visible = False
    Panning.MouseWheel = pmwNone
    RightAxis.LabelsFont.Name = 'Tahoma'
    RightAxis.Title.Font.Name = 'Tahoma'
    TopAxis.LabelsFont.Name = 'Tahoma'
    TopAxis.Title.Font.Name = 'Tahoma'
    View3DOptions.Elevation = 315
    View3DOptions.Orthogonal = False
    View3DOptions.Perspective = 0
    View3DOptions.Rotation = 360
    Zoom.Allow = False
    OnAfterDraw = DBChart1AfterDraw
    OnBeforeDrawChart = DBChart1BeforeDrawChart
    Align = alClient
    TabOrder = 0
    OnClick = DBChart1Click
    ColorPaletteIndex = 13
    object Series1: TPieSeries
      LegendTitle = #1580#1606#1587#1740#1578
      Cursor = crHandPoint
      Marks.Arrow.Visible = True
      Marks.Callout.Brush.Color = clBlack
      Marks.Callout.Arrow.Visible = True
      Marks.Visible = True
      Title = #1580#1606#1587#1740#1578
      XValues.Order = loAscending
      YValues.Name = 'Pie'
      YValues.Order = loNone
      OnClick = Series1Click
      ExplodeBiggest = 15
      Frame.InnerBrush.BackColor = clRed
      Frame.InnerBrush.Gradient.EndColor = clGray
      Frame.InnerBrush.Gradient.MidColor = clWhite
      Frame.InnerBrush.Gradient.StartColor = 4210752
      Frame.InnerBrush.Gradient.Visible = True
      Frame.MiddleBrush.BackColor = clYellow
      Frame.MiddleBrush.Gradient.EndColor = 8553090
      Frame.MiddleBrush.Gradient.MidColor = clWhite
      Frame.MiddleBrush.Gradient.StartColor = clGray
      Frame.MiddleBrush.Gradient.Visible = True
      Frame.OuterBrush.BackColor = clGreen
      Frame.OuterBrush.Gradient.EndColor = 4210752
      Frame.OuterBrush.Gradient.MidColor = clWhite
      Frame.OuterBrush.Gradient.StartColor = clSilver
      Frame.OuterBrush.Gradient.Visible = True
      Frame.Visible = False
      Frame.Width = 4
      OtherSlice.Legend.Visible = False
      PiePen.Visible = False
      RotationAngle = 75
    end
    object Series2: TPieSeries
      Cursor = crHandPoint
      Marks.Arrow.Visible = True
      Marks.Callout.Brush.Color = clBlack
      Marks.Callout.Arrow.Visible = True
      Marks.Visible = True
      SeriesColor = clRed
      Title = #1576#1740#1605#1607' '#1711#1586#1575#1585#1575#1606
      XValues.Order = loAscending
      YValues.Name = 'Pie'
      YValues.Order = loNone
      OnClick = Series1Click
      ExplodeBiggest = 15
      Frame.InnerBrush.BackColor = clRed
      Frame.InnerBrush.Gradient.EndColor = clGray
      Frame.InnerBrush.Gradient.MidColor = clWhite
      Frame.InnerBrush.Gradient.StartColor = 4210752
      Frame.InnerBrush.Gradient.Visible = True
      Frame.MiddleBrush.BackColor = clYellow
      Frame.MiddleBrush.Gradient.EndColor = 8553090
      Frame.MiddleBrush.Gradient.MidColor = clWhite
      Frame.MiddleBrush.Gradient.StartColor = clGray
      Frame.MiddleBrush.Gradient.Visible = True
      Frame.OuterBrush.BackColor = clGreen
      Frame.OuterBrush.Gradient.EndColor = 4210752
      Frame.OuterBrush.Gradient.MidColor = clWhite
      Frame.OuterBrush.Gradient.StartColor = clSilver
      Frame.OuterBrush.Gradient.Visible = True
      Frame.Visible = False
      Frame.Width = 4
      OtherSlice.Legend.Visible = False
      PiePen.Visible = False
      RotationAngle = 75
    end
    object Series3: TPieSeries
      LegendTitle = #1576#1740#1605#1607' '#1711#1586#1575#1585#1575#1606' '#1605#1705#1605#1604
      Cursor = crHandPoint
      Marks.Arrow.Visible = True
      Marks.Callout.Brush.Color = clBlack
      Marks.Callout.Arrow.Visible = True
      Marks.Visible = True
      Title = #1576#1740#1605#1607' '#1711#1586#1575#1585#1575#1606' '#1605#1705#1605#1604
      XValues.Order = loAscending
      YValues.Name = 'Pie'
      YValues.Order = loNone
      OnClick = Series1Click
      ExplodeBiggest = 15
      Frame.InnerBrush.BackColor = clRed
      Frame.InnerBrush.Gradient.EndColor = clGray
      Frame.InnerBrush.Gradient.MidColor = clWhite
      Frame.InnerBrush.Gradient.StartColor = 4210752
      Frame.InnerBrush.Gradient.Visible = True
      Frame.MiddleBrush.BackColor = clYellow
      Frame.MiddleBrush.Gradient.EndColor = 8553090
      Frame.MiddleBrush.Gradient.MidColor = clWhite
      Frame.MiddleBrush.Gradient.StartColor = clGray
      Frame.MiddleBrush.Gradient.Visible = True
      Frame.OuterBrush.BackColor = clGreen
      Frame.OuterBrush.Gradient.EndColor = 4210752
      Frame.OuterBrush.Gradient.MidColor = clWhite
      Frame.OuterBrush.Gradient.StartColor = clSilver
      Frame.OuterBrush.Gradient.Visible = True
      Frame.Visible = False
      Frame.Width = 4
      OtherSlice.Legend.Visible = False
      PiePen.Visible = False
      RotationAngle = 75
    end
    object Series4: TPieSeries
      Cursor = crHandPoint
      Marks.Arrow.Visible = True
      Marks.Callout.Brush.Color = clBlack
      Marks.Callout.Arrow.Visible = True
      Marks.Visible = True
      Title = #1662#1586#1588#1705#1575#1606
      XValues.Order = loAscending
      YValues.Name = 'Pie'
      YValues.Order = loNone
      OnClick = Series1Click
      ExplodeBiggest = 15
      Frame.InnerBrush.BackColor = clRed
      Frame.InnerBrush.Gradient.EndColor = clGray
      Frame.InnerBrush.Gradient.MidColor = clWhite
      Frame.InnerBrush.Gradient.StartColor = 4210752
      Frame.InnerBrush.Gradient.Visible = True
      Frame.MiddleBrush.BackColor = clYellow
      Frame.MiddleBrush.Gradient.EndColor = 8553090
      Frame.MiddleBrush.Gradient.MidColor = clWhite
      Frame.MiddleBrush.Gradient.StartColor = clGray
      Frame.MiddleBrush.Gradient.Visible = True
      Frame.OuterBrush.BackColor = clGreen
      Frame.OuterBrush.Gradient.EndColor = 4210752
      Frame.OuterBrush.Gradient.MidColor = clWhite
      Frame.OuterBrush.Gradient.StartColor = clSilver
      Frame.OuterBrush.Gradient.Visible = True
      Frame.Visible = False
      Frame.Width = 4
      OtherSlice.Legend.Visible = False
      PiePen.Visible = False
      RotationAngle = 75
    end
    object Series5: TPieSeries
      Cursor = crHandPoint
      Marks.Arrow.Visible = True
      Marks.Callout.Brush.Color = clBlack
      Marks.Callout.Arrow.Visible = True
      Marks.Visible = True
      Title = #1576#1582#1588' '#1607#1575
      XValues.Order = loAscending
      YValues.Name = 'Pie'
      YValues.Order = loNone
      OnClick = Series1Click
      ExplodeBiggest = 15
      Frame.InnerBrush.BackColor = clRed
      Frame.InnerBrush.Gradient.EndColor = clGray
      Frame.InnerBrush.Gradient.MidColor = clWhite
      Frame.InnerBrush.Gradient.StartColor = 4210752
      Frame.InnerBrush.Gradient.Visible = True
      Frame.MiddleBrush.BackColor = clYellow
      Frame.MiddleBrush.Gradient.EndColor = 8553090
      Frame.MiddleBrush.Gradient.MidColor = clWhite
      Frame.MiddleBrush.Gradient.StartColor = clGray
      Frame.MiddleBrush.Gradient.Visible = True
      Frame.OuterBrush.BackColor = clGreen
      Frame.OuterBrush.Gradient.EndColor = 4210752
      Frame.OuterBrush.Gradient.MidColor = clWhite
      Frame.OuterBrush.Gradient.StartColor = clSilver
      Frame.OuterBrush.Gradient.Visible = True
      Frame.Visible = False
      Frame.Width = 4
      OtherSlice.Legend.Visible = False
      PiePen.Visible = False
      RotationAngle = 75
    end
  end
  object qStats: TADOQuery
    Connection = dmLabData.ADOConnection
    ExecuteOptions = [eoAsyncExecute]
    Parameters = <>
    Left = 48
    Top = 40
  end
  object tmAdminStats: TJvTimer
    Enabled = False
    Interval = 5000
    OnTimer = tmAdminStatsTimer
    Left = 48
    Top = 112
  end
end
iMan Biglari
  • 4,674
  • 1
  • 38
  • 83
  • How about some code so that we can reproduce – David Heffernan Oct 08 '12 at 07:26
  • @DavidHeffernan There is actually no code. Each Pie is directly drawn from a query. Something like `SELECT COUNT(TestID) AS [Cnt], PatientTestSections.Name FROM PatientTests, PatientTestSections WHERE PatientTests.Sec=PatientTestSections.SecID AND PatientTests.PID=PatientTestSections.PID GROUP BY PatientTestSections.Name` for the last chart – iMan Biglari Oct 08 '12 at 07:27
  • @DavidHeffernan I forgot. I have this code in the `AfterDraw` to write the title of each series: `var i, X, Y: Integer; begin for i := 0 to DBChart1.SeriesCount - 1 do with (DBChart1.Series[i] as TPieSeries), DBChart1.Canvas do if Visible then begin X := CircleXCenter - (TextWidth(Title) div 2); Y := CircleRect.Top + (CircleRect.Bottom - CircleRect.Top) div 2; TextOut(X, Y, Title); end; end; ` – iMan Biglari Oct 08 '12 at 07:28
  • I don't understand what you mean by "truncated"? What exactly is wrong with the output? – mj2008 Oct 08 '12 at 08:54
  • @mj2008 On the 2nd picture, the upper left section of the pie has _two_ dark edges, while it should have one, and the smallest section doesn't reach the center of the pie, while it should. – iMan Biglari Oct 08 '12 at 09:35
  • It may depend on the data itself, that produces a determinate angle of the slices. Could you please tell us what values does this pie have? – Yeray Oct 08 '12 at 10:01
  • @Yeray A=15 B=27 C=4 D=1 – iMan Biglari Oct 08 '12 at 10:23

1 Answers1

1

I'm afraid this is a known problem as you can read here. It's not a trivial problem that would probably need a complete redesign of the series to be fixed.

Yeray
  • 5,009
  • 1
  • 13
  • 25
  • However, it will probably work fine with OpenGL: http://www.teechart.net/support/viewtopic.php?f=3&t=11921&p=51107#p52331 – Yeray Oct 09 '12 at 08:56