TeeChart7 PieChart Percent display error
Posted: Tue May 25, 2004 3:22 pm
Hi there,
last week I updated our software package from TeeChart6.X to
TeeChart 7. One PieChart which previously displayed correct percentage values now displays wrong percentage values (always smaller than 100%). If I add up the displayed values they are much smaller than 100% whereas the data/numbers which are given to the chart add exactly up to 100%.
I extracted an example application:
// Begin of form file
object Form1: TForm1
Left = 190
Top = 131
Width = 449
Height = 330
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Button1: TButton
Left = 176
Top = 264
Width = 129
Height = 25
Caption = 'Show percents'
TabOrder = 0
OnClick = Button1Click
end
object QuantChart: TChart
Left = 0
Top = 0
Width = 441
Height = 257
HelpContext = 85260
AllowPanning = pmNone
BackWall.Brush.Color = clWhite
BackWall.Brush.Style = bsClear
BackWall.Pen.Visible = False
Gradient.Visible = True
Legend.ResizeChart = False
Legend.TextStyle = ltsPlain
Legend.Visible = False
Title.AdjustFrame = False
Title.Text.Strings = (
'Rietveld Qunatification Results')
Title.Visible = False
AxisVisible = False
ClipPoints = False
Frame.Visible = False
View3D = False
View3DOptions.Elevation = 315
View3DOptions.Orthogonal = False
View3DOptions.Perspective = 0
View3DOptions.Rotation = 360
View3DOptions.Zoom = 102
View3DWalls = False
Zoom.Allow = False
Align = alTop
BevelOuter = bvLowered
TabOrder = 1
PrintMargins = (
15
43
15
43)
object PieSeries: TPieSeries
Marks.Callout.Brush.Color = clBlack
Marks.Style = smsLabelPercent
Marks.Visible = True
PercentFormat = '##0.# %'
ShowInLegend = False
Circled = True
ExplodeBiggest = 20
Gradient.Direction = gdRadial
OtherSlice.Legend.Visible = False
PieValues.Name = 'Pie'
PieValues.Order = loDescending
end
end
end
// End of form file
// Begin PAS file:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, TeEngine, Series, ExtCtrls, TeeProcs, Chart;
type
TForm1 = class(TForm)
Button1: TButton;
QuantChart: TChart;
PieSeries: TPieSeries;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
QuantChart.SeriesList.Items[0].Clear;
QuantChart.SeriesList.Items[0].Add(20, 'Test First Red', clRed);
QuantChart.SeriesList.Items[0].Add(40, 'Test Second Green', clGreen);
QuantChart.SeriesList.Items[0].Add(40, 'Test Third Blue', clBlue);
QuantChart.SeriesList.Items[0].Marks.Style := smsPercent;
end;
end.
// End of PAS file
last week I updated our software package from TeeChart6.X to
TeeChart 7. One PieChart which previously displayed correct percentage values now displays wrong percentage values (always smaller than 100%). If I add up the displayed values they are much smaller than 100% whereas the data/numbers which are given to the chart add exactly up to 100%.
I extracted an example application:
// Begin of form file
object Form1: TForm1
Left = 190
Top = 131
Width = 449
Height = 330
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Button1: TButton
Left = 176
Top = 264
Width = 129
Height = 25
Caption = 'Show percents'
TabOrder = 0
OnClick = Button1Click
end
object QuantChart: TChart
Left = 0
Top = 0
Width = 441
Height = 257
HelpContext = 85260
AllowPanning = pmNone
BackWall.Brush.Color = clWhite
BackWall.Brush.Style = bsClear
BackWall.Pen.Visible = False
Gradient.Visible = True
Legend.ResizeChart = False
Legend.TextStyle = ltsPlain
Legend.Visible = False
Title.AdjustFrame = False
Title.Text.Strings = (
'Rietveld Qunatification Results')
Title.Visible = False
AxisVisible = False
ClipPoints = False
Frame.Visible = False
View3D = False
View3DOptions.Elevation = 315
View3DOptions.Orthogonal = False
View3DOptions.Perspective = 0
View3DOptions.Rotation = 360
View3DOptions.Zoom = 102
View3DWalls = False
Zoom.Allow = False
Align = alTop
BevelOuter = bvLowered
TabOrder = 1
PrintMargins = (
15
43
15
43)
object PieSeries: TPieSeries
Marks.Callout.Brush.Color = clBlack
Marks.Style = smsLabelPercent
Marks.Visible = True
PercentFormat = '##0.# %'
ShowInLegend = False
Circled = True
ExplodeBiggest = 20
Gradient.Direction = gdRadial
OtherSlice.Legend.Visible = False
PieValues.Name = 'Pie'
PieValues.Order = loDescending
end
end
end
// End of form file
// Begin PAS file:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, TeEngine, Series, ExtCtrls, TeeProcs, Chart;
type
TForm1 = class(TForm)
Button1: TButton;
QuantChart: TChart;
PieSeries: TPieSeries;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
QuantChart.SeriesList.Items[0].Clear;
QuantChart.SeriesList.Items[0].Add(20, 'Test First Red', clRed);
QuantChart.SeriesList.Items[0].Add(40, 'Test Second Green', clGreen);
QuantChart.SeriesList.Items[0].Add(40, 'Test Third Blue', clBlue);
QuantChart.SeriesList.Items[0].Marks.Style := smsPercent;
end;
end.
// End of PAS file