【问题标题】:What causes a TeeChart PieSerie to be truncated?是什么导致 TeeChart PieSerie 被截断?
【发布时间】:2012-10-08 07:20:27
【问题描述】:

我有一个DBChart,上面有 5 个PieSerie。 注意最后一个饼图是如何被截断的。我能做些什么来避免这种情况吗?我正在使用 TeeChart Standard v2011.03.32815 VCL;除了更改颜色主题外,我没有更改图表的任何属性。

这是包含DBChart的帧的DFM

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

【问题讨论】:

  • 要一些代码让我们重现
  • @DavidHeffernan 实际上没有代码。每个 Pie 都是直接从查询中提取的。最后一张图表类似于SELECT COUNT(TestID) AS [Cnt], PatientTestSections.Name FROM PatientTests, PatientTestSections WHERE PatientTests.Sec=PatientTestSections.SecID AND PatientTests.PID=PatientTestSections.PID GROUP BY PatientTestSections.Name
  • @DavidHeffernan 我忘了。我在AfterDraw有这段代码写每个系列的标题: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;
  • 我不明白你所说的“截断”是什么意思?输出到底有什么问题?
  • @mj2008 第二张图,饼图左上部分有两条暗边,应该有一条,最小的部分没有到达中心馅饼,虽然它应该。

标签: delphi delphi-xe2 teechart


【解决方案1】:

恐怕这是一个已知问题,您可以阅读here。这不是一个微不足道的问题,可能需要对系列进行完全重新设计才能解决。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-01-23
  • 2011-08-20
  • 1970-01-01
  • 2012-07-19
  • 1970-01-01
  • 1970-01-01
  • 2018-07-05
相关资源
最近更新 更多