View Issue Details

IDProjectCategoryView StatusLast Update
0012642PatchesLCLpublic2008-11-26 15:04
ReporterAlexander S. Klenin Assigned ToDarius Blaszijk  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.27 (SVN) 
Fixed in Version0.9.27 (SVN) 
Summary0012642: TAChart: speed up AddXY function for long series
DescriptionTChartSeries.AddXY inserts new point into a sorted list, which have O(N^2) computational cost.
This can be a problem for really long (>10000 points) series.

This issue is not entirely theoretical, and was reported by at least one
user (in Russian): http://freepascal.ru/forum/viewtopic.php?f=5&t=3821

Attached patch partially avoids the problem by changing algorithm so it amortized O(N) cost in the important particular case of already ordered points.
We now can advise the users to pre-sort their points by X coordinate to avoid speed penalty.
Steps To ReproduceSee the second attached patch, which makes it possibile to add many points at once to the TAChart demo.
Try adding 100000 points with and without the optimization patch.
I am not sure if the demo patch should be applied -- on the one hand, it may be helpful for some users. On the other hand, the point of the demo it to be as simple as possible -- and this patch adds (a small amount of) complexity.
TagsNo tags attached.
Fixed in Revision17504
LazTarget
Widgetset
Attached Files

Relationships

has duplicate 0011723 closedDarius Blaszijk Packages TAChart performance - adding new points to line chart is getting slower with more values in chart 

Activities

2008-11-15 17:55

 

taseries_addxy_speedup.patch (1,378 bytes)   
Index: taseries.pas
===================================================================
--- taseries.pas	(revision 17399)
+++ taseries.pas	(working copy)
@@ -387,24 +387,23 @@
 
 function TChartSeries.AddXY(X, Y: Double; XLabel: String; Color: TColor): Longint;
 var
-  coordn: PChartCoord;
-  i: Integer;
+  pcc: PChartCoord;
 begin
-  //save the coord and color
-  New(coordn);
-  coordn^.x := X;
-  coordn^.y := Y;
-  coordn^.Color := Color;
-  coordn^.Text := XLabel;
+  New(pcc);
+  pcc^.x := X;
+  pcc^.y := Y;
+  pcc^.Color := Color;
+  pcc^.Text := XLabel;
 
-  //add in order or at end
-  i := 0;
-  while (i < FCoordList.Count) and (PChartCoord(FCoordList.Items[i])^.x <= X) do
-    Inc(i);
-  if i = FCoordList.Count then FCoordList.Add(coordn)
-  else FCoordList.Insert(i, coordn);
-
-  Result := FCoordList.IndexOf(coordn);
+  // We keep FCoordList ordered by X coordinate.
+  // Note that this leads to O(N^2) time except
+  // for the case of adding already ordered points.
+  // So, is the user wants to add many (>10000) points to a graph,
+  // he should pre-sort them to avoid performance penalty.
+  Result := FCoordList.Count;
+  while (Result > 0) and (PChartCoord(FCoordList.Items[Result - 1])^.x > X) do
+    Dec(Result);
+  FCoordList.Insert(Result, pcc);
 end;
 
 function TChartSeries.Add(AValue: Double; XLabel: String; Color: TColor): Longint;
taseries_addxy_speedup.patch (1,378 bytes)   

2008-11-15 17:56

 

taseries_addxy_speedup_demo.patch (42,512 bytes)   
Index: unit1.lfm
===================================================================
--- unit1.lfm	(revision 17399)
+++ unit1.lfm	(working copy)
@@ -1,90 +1,46 @@
 object Form1: TForm1
-  Left = 345
+  Left = 470
   Height = 499
-  Top = 114
+  Top = 248
   Width = 585
-  HelpContext = 0
-  ActiveControl = Panel1
-  Align = alNone
-  AllowDropFiles = False
-  AutoScroll = True
-  AutoSize = False
-  BorderIcons = [biSystemMenu, biMinimize, biMaximize]
-  BorderStyle = bsSizeable
   Caption = 'Form1'
-  ChildSizing.LeftRightSpacing = 0
-  ChildSizing.TopBottomSpacing = 0
-  ChildSizing.HorizontalSpacing = 0
-  ChildSizing.VerticalSpacing = 0
-  ChildSizing.ControlsPerLine = 0
   ClientHeight = 499
   ClientWidth = 585
-  DockSite = False
-  DragKind = dkDrag
-  DragMode = dmManual
-  Enabled = True
-  Font.Height = 0
-  Font.Style = []
-  FormStyle = fsNormal
-  ParentBiDiMode = True
   ParentFont = False
-  Position = poScreenCenter
-  ShowInTaskBar = stDefault
-  UseDockManager = False
   LCLVersion = '0.9.27'
-  WindowState = wsNormal
   object Chart1: TChart
-    Left = 0
-    Height = 424
-    Top = 0
+    Height = 430
     Width = 585
-    HelpContext = 0
-    MirrorX = False
-    ShowVerticalReticule = False
-    ShowReticule = False
-    Legend.Visible = False
     Legend.Alignment = laRight
     Legend.Font.Height = -11
     Legend.Font.Name = 'MS Sans Serif'
-    Legend.Font.Style = []
-    Legend.Frame.Visible = False
     Title.Visible = True
     Title.Brush.Color = clBtnFace
     Title.Font.Color = clBlue
     Title.Font.Height = -11
     Title.Font.Name = 'MS Sans Serif'
-    Title.Font.Style = []
-    Title.Frame.Visible = False
     Title.Alignment = taCenter
     Title.Text.Strings = (
       'Centered Chart Title'
     )
-    Foot.Visible = False
     Foot.Brush.Color = clBtnFace
     Foot.Font.Color = clRed
     Foot.Font.Height = -13
     Foot.Font.Name = 'MS Sans Serif'
     Foot.Font.Style = [fsBold]
-    Foot.Frame.Visible = False
-    Foot.Alignment = taLeftJustify
     Foot.Text.Strings = (
       'This a LeftAligned Footer'
     )
     LeftAxis.Visible = True
-    LeftAxis.Inverted = False
     LeftAxis.Title.Angle = 90
     LeftAxis.Title.Font.Height = -11
     LeftAxis.Title.Font.Name = 'MS Sans Serif'
-    LeftAxis.Title.Font.Style = []
     LeftAxis.Grid.Color = clGray
     LeftAxis.Grid.Style = psDot
     LeftAxis.Grid.Visible = True
     BottomAxis.Visible = True
-    BottomAxis.Inverted = False
-    BottomAxis.Title.Angle = 0
     BottomAxis.Title.Font.Height = -11
     BottomAxis.Title.Font.Name = 'MS Sans Serif'
-    BottomAxis.Title.Font.Style = []
     BottomAxis.Grid.Color = clGray
     BottomAxis.Grid.Style = psDot
     BottomAxis.Grid.Visible = True
@@ -92,560 +48,181 @@
     BackColor = clBtnFace
     Align = alClient
     Color = clBtnFace
-    DragCursor = crDrag
-    DragMode = dmManual
-    Enabled = True
     ParentColor = False
-    ParentShowHint = True
-    Visible = True
   end
   object Panel1: TPanel
-    Left = 0
-    Height = 75
-    Top = 424
+    Height = 69
+    Top = 430
     Width = 585
-    HelpContext = 0
     Align = alBottom
-    Alignment = taCenter
-    AutoSize = False
-    BorderSpacing.Left = 0
-    BorderSpacing.Top = 0
-    BorderSpacing.Right = 0
-    BorderSpacing.Bottom = 0
-    BorderSpacing.Around = 0
-    BorderSpacing.CellAlignHorizontal = ccaFill
-    BorderSpacing.CellAlignVertical = ccaFill
-    BevelInner = bvNone
-    BevelOuter = bvRaised
-    BevelWidth = 1
-    BorderWidth = 0
-    BorderStyle = bsNone
-    ChildSizing.LeftRightSpacing = 0
-    ChildSizing.TopBottomSpacing = 0
-    ChildSizing.HorizontalSpacing = 0
-    ChildSizing.VerticalSpacing = 0
-    ChildSizing.ControlsPerLine = 0
-    ClientHeight = 75
+    ClientHeight = 69
     ClientWidth = 585
-    DockSite = False
-    DragCursor = crDrag
-    DragKind = dkDrag
-    DragMode = dmManual
-    Enabled = True
-    FullRepaint = True
-    ParentColor = True
-    ParentFont = True
-    ParentShowHint = True
     TabOrder = 0
-    TabStop = False
-    Visible = True
     object lblAdd: TLabel
       Left = 13
-      Height = 18
+      Height = 14
       Top = 10
-      Width = 30
-      HelpContext = 0
-      Align = alNone
-      Alignment = taLeftJustify
-      AutoSize = True
-      BorderSpacing.Left = 0
-      BorderSpacing.Top = 0
-      BorderSpacing.Right = 0
-      BorderSpacing.Bottom = 0
-      BorderSpacing.Around = 0
-      BorderSpacing.CellAlignHorizontal = ccaFill
-      BorderSpacing.CellAlignVertical = ccaFill
+      Width = 24
       Caption = 'Add:'
-      DragCursor = crDrag
-      DragMode = dmManual
-      Enabled = True
-      Layout = tlTop
-      ParentBidiMode = True
       ParentColor = False
-      ParentFont = True
-      ParentShowHint = True
-      ShowAccelChar = True
-      Transparent = True
-      Visible = True
-      WordWrap = False
-      OptimalFill = False
     end
     object lblAdd1: TLabel
       Left = 13
-      Height = 18
-      Top = 42
-      Width = 38
-      HelpContext = 0
-      Align = alNone
-      Alignment = taLeftJustify
-      AutoSize = True
-      BorderSpacing.Left = 0
-      BorderSpacing.Top = 0
-      BorderSpacing.Right = 0
-      BorderSpacing.Bottom = 0
-      BorderSpacing.Around = 0
-      BorderSpacing.CellAlignHorizontal = ccaFill
-      BorderSpacing.CellAlignVertical = ccaFill
+      Height = 14
+      Top = 40
+      Width = 30
       Caption = 'Clear:'
-      DragCursor = crDrag
-      DragMode = dmManual
-      Enabled = True
-      Layout = tlTop
-      ParentBidiMode = True
       ParentColor = False
-      ParentFont = True
-      ParentShowHint = True
-      ShowAccelChar = True
-      Transparent = True
-      Visible = True
-      WordWrap = False
-      OptimalFill = False
     end
     object btnAddPie: TButton
-      Left = 64
-      Height = 25
+      Left = 48
+      Height = 21
       Top = 8
       Width = 52
-      HelpContext = 0
-      Align = alNone
-      AutoSize = False
-      BorderSpacing.Left = 0
-      BorderSpacing.Top = 0
-      BorderSpacing.Right = 0
-      BorderSpacing.Bottom = 0
-      BorderSpacing.Around = 0
       BorderSpacing.InnerBorder = 4
-      BorderSpacing.CellAlignHorizontal = ccaFill
-      BorderSpacing.CellAlignVertical = ccaFill
-      Cancel = False
       Caption = 'Pie'
-      Default = False
-      DragCursor = crDrag
-      DragMode = dmManual
-      Enabled = True
-      ParentBidiMode = True
-      ModalResult = 0
       OnClick = btnAddPieClick
-      ParentFont = True
-      ParentShowHint = True
       TabOrder = 0
-      TabStop = True
-      Visible = True
     end
     object btnAddLine: TButton
-      Left = 232
-      Height = 25
+      Left = 216
+      Height = 21
       Top = 8
       Width = 52
-      HelpContext = 0
-      Align = alNone
-      AutoSize = False
-      BorderSpacing.Left = 0
-      BorderSpacing.Top = 0
-      BorderSpacing.Right = 0
-      BorderSpacing.Bottom = 0
-      BorderSpacing.Around = 0
       BorderSpacing.InnerBorder = 4
-      BorderSpacing.CellAlignHorizontal = ccaFill
-      BorderSpacing.CellAlignVertical = ccaFill
-      Cancel = False
       Caption = 'Line'
-      Default = False
-      DragCursor = crDrag
-      DragMode = dmManual
-      Enabled = True
-      ParentBidiMode = True
-      ModalResult = 0
       OnClick = btnAddLineClick
-      ParentFont = True
-      ParentShowHint = True
       TabOrder = 1
-      TabStop = True
-      Visible = True
     end
     object btnAddArea: TButton
-      Left = 120
-      Height = 25
+      Left = 104
+      Height = 21
       Top = 8
       Width = 52
-      HelpContext = 0
-      Align = alNone
-      AutoSize = False
-      BorderSpacing.Left = 0
-      BorderSpacing.Top = 0
-      BorderSpacing.Right = 0
-      BorderSpacing.Bottom = 0
-      BorderSpacing.Around = 0
       BorderSpacing.InnerBorder = 4
-      BorderSpacing.CellAlignHorizontal = ccaFill
-      BorderSpacing.CellAlignVertical = ccaFill
-      Cancel = False
       Caption = 'Area'
-      Default = False
-      DragCursor = crDrag
-      DragMode = dmManual
-      Enabled = True
-      ParentBidiMode = True
-      ModalResult = 0
       OnClick = btnAddAreaClick
-      ParentFont = True
-      ParentShowHint = True
       TabOrder = 2
-      TabStop = True
-      Visible = True
     end
     object btnAddBar: TButton
-      Left = 176
-      Height = 25
+      Left = 160
+      Height = 21
       Top = 8
       Width = 52
-      HelpContext = 0
-      Align = alNone
-      AutoSize = False
-      BorderSpacing.Left = 0
-      BorderSpacing.Top = 0
-      BorderSpacing.Right = 0
-      BorderSpacing.Bottom = 0
-      BorderSpacing.Around = 0
       BorderSpacing.InnerBorder = 4
-      BorderSpacing.CellAlignHorizontal = ccaFill
-      BorderSpacing.CellAlignVertical = ccaFill
-      Cancel = False
       Caption = 'Bar'
-      Default = False
-      DragCursor = crDrag
-      DragMode = dmManual
-      Enabled = True
-      ParentBidiMode = True
-      ModalResult = 0
       OnClick = btnAddBarClick
-      ParentFont = True
-      ParentShowHint = True
       TabOrder = 3
-      TabStop = True
-      Visible = True
     end
     object cbLegend: TCheckBox
       Left = 408
-      Height = 22
+      Height = 19
       Top = 8
-      Width = 71
-      HelpContext = 0
-      Align = alNone
-      AllowGrayed = False
-      AutoSize = True
-      BorderSpacing.Left = 0
-      BorderSpacing.Top = 0
-      BorderSpacing.Right = 0
-      BorderSpacing.Bottom = 0
-      BorderSpacing.Around = 0
-      BorderSpacing.CellAlignHorizontal = ccaFill
-      BorderSpacing.CellAlignVertical = ccaFill
+      Width = 61
       Caption = 'Legend'
-      Checked = False
-      DragCursor = crDrag
-      DragKind = dkDrag
-      DragMode = dmManual
-      Enabled = True
       OnChange = cbLegendChange
-      ParentColor = True
-      ParentFont = True
-      ParentShowHint = True
-      ParentBidiMode = True
-      State = cbUnchecked
       TabOrder = 4
-      TabStop = True
-      UseOnChange = False
-      Visible = True
     end
     object cbBottomAxis: TCheckBox
       Left = 408
-      Height = 22
+      Height = 19
       Top = 24
-      Width = 102
-      HelpContext = 0
-      Align = alNone
-      AllowGrayed = False
-      AutoSize = True
-      BorderSpacing.Left = 0
-      BorderSpacing.Top = 0
-      BorderSpacing.Right = 0
-      BorderSpacing.Bottom = 0
-      BorderSpacing.Around = 0
-      BorderSpacing.CellAlignHorizontal = ccaFill
-      BorderSpacing.CellAlignVertical = ccaFill
+      Width = 83
       Caption = 'Bottom Axis'
       Checked = True
-      DragCursor = crDrag
-      DragKind = dkDrag
-      DragMode = dmManual
-      Enabled = True
       OnChange = cbBottomAxisChange
-      ParentColor = True
-      ParentFont = True
-      ParentShowHint = True
-      ParentBidiMode = True
       State = cbChecked
       TabOrder = 5
-      TabStop = True
-      UseOnChange = False
-      Visible = True
     end
     object cbLeftAxis: TCheckBox
       Left = 408
-      Height = 22
+      Height = 19
       Top = 40
-      Width = 78
-      HelpContext = 0
-      Align = alNone
-      AllowGrayed = False
-      AutoSize = True
-      BorderSpacing.Left = 0
-      BorderSpacing.Top = 0
-      BorderSpacing.Right = 0
-      BorderSpacing.Bottom = 0
-      BorderSpacing.Around = 0
-      BorderSpacing.CellAlignHorizontal = ccaFill
-      BorderSpacing.CellAlignVertical = ccaFill
+      Width = 68
       Caption = 'Left Axis'
       Checked = True
-      DragCursor = crDrag
-      DragKind = dkDrag
-      DragMode = dmManual
-      Enabled = True
       OnChange = cbLeftAxisChange
-      ParentColor = True
-      ParentFont = True
-      ParentShowHint = True
-      ParentBidiMode = True
       State = cbChecked
       TabOrder = 6
-      TabStop = True
-      UseOnChange = False
-      Visible = True
     end
     object cbTitle: TCheckBox
       Left = 496
-      Height = 22
+      Height = 19
       Top = 8
-      Width = 50
-      HelpContext = 0
-      Align = alNone
-      AllowGrayed = False
-      AutoSize = True
-      BorderSpacing.Left = 0
-      BorderSpacing.Top = 0
-      BorderSpacing.Right = 0
-      BorderSpacing.Bottom = 0
-      BorderSpacing.Around = 0
-      BorderSpacing.CellAlignHorizontal = ccaFill
-      BorderSpacing.CellAlignVertical = ccaFill
+      Width = 46
       Caption = 'Title'
       Checked = True
-      DragCursor = crDrag
-      DragKind = dkDrag
-      DragMode = dmManual
-      Enabled = True
       OnChange = cbTitleChange
-      ParentColor = True
-      ParentFont = True
-      ParentShowHint = True
-      ParentBidiMode = True
       State = cbChecked
       TabOrder = 7
-      TabStop = True
-      UseOnChange = False
-      Visible = True
     end
     object cbFooter: TCheckBox
       Left = 496
-      Height = 22
+      Height = 19
       Top = 24
-      Width = 65
-      HelpContext = 0
-      Align = alNone
-      AllowGrayed = False
-      AutoSize = True
-      BorderSpacing.Left = 0
-      BorderSpacing.Top = 0
-      BorderSpacing.Right = 0
-      BorderSpacing.Bottom = 0
-      BorderSpacing.Around = 0
-      BorderSpacing.CellAlignHorizontal = ccaFill
-      BorderSpacing.CellAlignVertical = ccaFill
+      Width = 58
       Caption = 'Footer'
-      Checked = False
-      DragCursor = crDrag
-      DragKind = dkDrag
-      DragMode = dmManual
-      Enabled = True
       OnChange = cbFooterChange
-      ParentColor = True
-      ParentFont = True
-      ParentShowHint = True
-      ParentBidiMode = True
-      State = cbUnchecked
       TabOrder = 8
-      TabStop = True
-      UseOnChange = False
-      Visible = True
     end
     object cbInverted: TCheckBox
       Left = 496
-      Height = 22
+      Height = 19
       Top = 40
-      Width = 76
-      HelpContext = 0
-      Align = alNone
-      AllowGrayed = False
-      AutoSize = True
-      BorderSpacing.Left = 0
-      BorderSpacing.Top = 0
-      BorderSpacing.Right = 0
-      BorderSpacing.Bottom = 0
-      BorderSpacing.Around = 0
-      BorderSpacing.CellAlignHorizontal = ccaFill
-      BorderSpacing.CellAlignVertical = ccaFill
+      Width = 68
       Caption = 'Inverted'
-      Checked = False
-      DragCursor = crDrag
-      DragKind = dkDrag
-      DragMode = dmManual
-      Enabled = True
       OnChange = cbInvertedChange
-      ParentColor = True
-      ParentFont = True
-      ParentShowHint = True
-      ParentBidiMode = True
-      State = cbUnchecked
       TabOrder = 9
-      TabStop = True
-      UseOnChange = False
-      Visible = True
     end
     object btnClearBar: TButton
-      Left = 176
-      Height = 25
-      Top = 40
+      Left = 160
+      Height = 21
+      Top = 38
       Width = 52
-      HelpContext = 0
-      Align = alNone
-      AutoSize = False
-      BorderSpacing.Left = 0
-      BorderSpacing.Top = 0
-      BorderSpacing.Right = 0
-      BorderSpacing.Bottom = 0
-      BorderSpacing.Around = 0
       BorderSpacing.InnerBorder = 4
-      BorderSpacing.CellAlignHorizontal = ccaFill
-      BorderSpacing.CellAlignVertical = ccaFill
-      Cancel = False
       Caption = 'Bar'
-      Default = False
-      DragCursor = crDrag
-      DragMode = dmManual
-      Enabled = True
-      ParentBidiMode = True
-      ModalResult = 0
       OnClick = btnClearBarClick
-      ParentFont = True
-      ParentShowHint = True
       TabOrder = 10
-      TabStop = True
-      Visible = True
     end
     object btnClearArea: TButton
-      Left = 120
-      Height = 25
-      Top = 40
+      Left = 104
+      Height = 21
+      Top = 38
       Width = 52
-      HelpContext = 0
-      Align = alNone
-      AutoSize = False
-      BorderSpacing.Left = 0
-      BorderSpacing.Top = 0
-      BorderSpacing.Right = 0
-      BorderSpacing.Bottom = 0
-      BorderSpacing.Around = 0
       BorderSpacing.InnerBorder = 4
-      BorderSpacing.CellAlignHorizontal = ccaFill
-      BorderSpacing.CellAlignVertical = ccaFill
-      Cancel = False
       Caption = 'Area'
-      Default = False
-      DragCursor = crDrag
-      DragMode = dmManual
-      Enabled = True
-      ParentBidiMode = True
-      ModalResult = 0
       OnClick = btnClearAreaClick
-      ParentFont = True
-      ParentShowHint = True
       TabOrder = 11
-      TabStop = True
-      Visible = True
     end
     object btnClearLine: TButton
-      Left = 232
-      Height = 25
-      Top = 40
+      Left = 216
+      Height = 21
+      Top = 38
       Width = 52
-      HelpContext = 0
-      Align = alNone
-      AutoSize = False
-      BorderSpacing.Left = 0
-      BorderSpacing.Top = 0
-      BorderSpacing.Right = 0
-      BorderSpacing.Bottom = 0
-      BorderSpacing.Around = 0
       BorderSpacing.InnerBorder = 4
-      BorderSpacing.CellAlignHorizontal = ccaFill
-      BorderSpacing.CellAlignVertical = ccaFill
-      Cancel = False
       Caption = 'Line'
-      Default = False
-      DragCursor = crDrag
-      DragMode = dmManual
-      Enabled = True
-      ParentBidiMode = True
-      ModalResult = 0
       OnClick = btnClearLineClick
-      ParentFont = True
-      ParentShowHint = True
       TabOrder = 12
-      TabStop = True
-      Visible = True
     end
     object btnClearPie: TButton
-      Left = 64
-      Height = 25
-      Top = 40
+      Left = 48
+      Height = 21
+      Top = 38
       Width = 52
-      HelpContext = 0
-      Align = alNone
-      AutoSize = False
-      BorderSpacing.Left = 0
-      BorderSpacing.Top = 0
-      BorderSpacing.Right = 0
-      BorderSpacing.Bottom = 0
-      BorderSpacing.Around = 0
       BorderSpacing.InnerBorder = 4
-      BorderSpacing.CellAlignHorizontal = ccaFill
-      BorderSpacing.CellAlignVertical = ccaFill
-      Cancel = False
       Caption = 'Pie'
-      Default = False
-      DragCursor = crDrag
-      DragMode = dmManual
-      Enabled = True
-      ParentBidiMode = True
-      ModalResult = 0
       OnClick = btnClearPieClick
-      ParentFont = True
-      ParentShowHint = True
       TabOrder = 13
-      TabStop = True
-      Visible = True
     end
+    object edAddCount: TSpinEdit
+      Left = 296
+      Height = 21
+      Top = 8
+      Width = 90
+      MaxValue = 1000000
+      MinValue = 1
+      TabOrder = 14
+      Value = 1
+    end
   end
 end
Index: unit1.lrs
===================================================================
--- unit1.lrs	(revision 17399)
+++ unit1.lrs	(working copy)
@@ -1,200 +1,65 @@
 { This is an automatically generated lazarus resource file }
 
 LazarusResources.Add('TForm1','FORMDATA',[
-  'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'Y'#1#6'Height'#3#243#1#3'Top'#2'r'#5'Widt'
-  +'h'#3'I'#2#11'HelpContext'#2#0#13'ActiveControl'#7#6'Panel1'#5'Align'#7#6'al'
-  +'None'#14'AllowDropFiles'#8#10'AutoScroll'#9#8'AutoSize'#8#11'BorderIcons'#11
-  +#12'biSystemMenu'#10'biMinimize'#10'biMaximize'#0#11'BorderStyle'#7#10'bsSiz'
-  +'eable'#7'Caption'#6#5'Form1'#28'ChildSizing.LeftRightSpacing'#2#0#28'ChildS'
-  +'izing.TopBottomSpacing'#2#0#29'ChildSizing.HorizontalSpacing'#2#0#27'ChildS'
-  +'izing.VerticalSpacing'#2#0#27'ChildSizing.ControlsPerLine'#2#0#12'ClientHei'
-  +'ght'#3#243#1#11'ClientWidth'#3'I'#2#8'DockSite'#8#8'DragKind'#7#6'dkDrag'#8
-  +'DragMode'#7#8'dmManual'#7'Enabled'#9#11'Font.Height'#2#0#10'Font.Style'#11#0
-  +#9'FormStyle'#7#8'fsNormal'#14'ParentBiDiMode'#9#10'ParentFont'#8#8'Position'
-  +#7#14'poScreenCenter'#13'ShowInTaskBar'#7#9'stDefault'#14'UseDockManager'#8
-  +#10'LCLVersion'#6#6'0.9.27'#11'WindowState'#7#8'wsNormal'#0#6'TChart'#6'Char'
-  +'t1'#4'Left'#2#0#6'Height'#3#168#1#3'Top'#2#0#5'Width'#3'I'#2#11'HelpContext'
-  +#2#0#7'MirrorX'#8#20'ShowVerticalReticule'#8#12'ShowReticule'#8#14'Legend.Vi'
-  +'sible'#8#16'Legend.Alignment'#7#7'laRight'#18'Legend.Font.Height'#2#245#16
-  +'Legend.Font.Name'#6#13'MS Sans Serif'#17'Legend.Font.Style'#11#0#20'Legend.'
-  +'Frame.Visible'#8#13'Title.Visible'#9#17'Title.Brush.Color'#7#9'clBtnFace'#16
-  +'Title.Font.Color'#7#6'clBlue'#17'Title.Font.Height'#2#245#15'Title.Font.Nam'
-  +'e'#6#13'MS Sans Serif'#16'Title.Font.Style'#11#0#19'Title.Frame.Visible'#8
-  +#15'Title.Alignment'#7#8'taCenter'#18'Title.Text.Strings'#1#6#20'Centered Ch'
-  +'art Title'#0#12'Foot.Visible'#8#16'Foot.Brush.Color'#7#9'clBtnFace'#15'Foot'
-  +'.Font.Color'#7#5'clRed'#16'Foot.Font.Height'#2#243#14'Foot.Font.Name'#6#13
-  +'MS Sans Serif'#15'Foot.Font.Style'#11#6'fsBold'#0#18'Foot.Frame.Visible'#8
-  +#14'Foot.Alignment'#7#13'taLeftJustify'#17'Foot.Text.Strings'#1#6#25'This a '
-  +'LeftAligned Footer'#0#16'LeftAxis.Visible'#9#17'LeftAxis.Inverted'#8#20'Lef'
-  +'tAxis.Title.Angle'#2'Z'#26'LeftAxis.Title.Font.Height'#2#245#24'LeftAxis.Ti'
-  +'tle.Font.Name'#6#13'MS Sans Serif'#25'LeftAxis.Title.Font.Style'#11#0#19'Le'
+  'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#214#1#6'Height'#3#243#1#3'Top'#3#248#0#5
+  +'Width'#3'I'#2#7'Caption'#6#5'Form1'#12'ClientHeight'#3#243#1#11'ClientWidth'
+  +#3'I'#2#10'ParentFont'#8#10'LCLVersion'#6#6'0.9.27'#0#6'TChart'#6'Chart1'#6
+  +'Height'#3#174#1#5'Width'#3'I'#2#16'Legend.Alignment'#7#7'laRight'#18'Legend'
+  +'.Font.Height'#2#245#16'Legend.Font.Name'#6#13'MS Sans Serif'#13'Title.Visib'
+  +'le'#9#17'Title.Brush.Color'#7#9'clBtnFace'#16'Title.Font.Color'#7#6'clBlue'
+  +#17'Title.Font.Height'#2#245#15'Title.Font.Name'#6#13'MS Sans Serif'#15'Titl'
+  +'e.Alignment'#7#8'taCenter'#18'Title.Text.Strings'#1#6#20'Centered Chart Tit'
+  +'le'#0#16'Foot.Brush.Color'#7#9'clBtnFace'#15'Foot.Font.Color'#7#5'clRed'#16
+  +'Foot.Font.Height'#2#243#14'Foot.Font.Name'#6#13'MS Sans Serif'#15'Foot.Font'
+  +'.Style'#11#6'fsBold'#0#17'Foot.Text.Strings'#1#6#25'This a LeftAligned Foot'
+  +'er'#0#16'LeftAxis.Visible'#9#20'LeftAxis.Title.Angle'#2'Z'#26'LeftAxis.Titl'
+  +'e.Font.Height'#2#245#24'LeftAxis.Title.Font.Name'#6#13'MS Sans Serif'#19'Le'
   +'ftAxis.Grid.Color'#7#6'clGray'#19'LeftAxis.Grid.Style'#7#5'psDot'#21'LeftAx'
-  +'is.Grid.Visible'#9#18'BottomAxis.Visible'#9#19'BottomAxis.Inverted'#8#22'Bo'
-  +'ttomAxis.Title.Angle'#2#0#28'BottomAxis.Title.Font.Height'#2#245#26'BottomA'
-  +'xis.Title.Font.Name'#6#13'MS Sans Serif'#27'BottomAxis.Title.Font.Style'#11
-  +#0#21'BottomAxis.Grid.Color'#7#6'clGray'#21'BottomAxis.Grid.Style'#7#5'psDot'
-  +#23'BottomAxis.Grid.Visible'#9#13'Frame.Visible'#9#9'BackColor'#7#9'clBtnFac'
-  +'e'#5'Align'#7#8'alClient'#5'Color'#7#9'clBtnFace'#10'DragCursor'#7#6'crDrag'
-  +#8'DragMode'#7#8'dmManual'#7'Enabled'#9#11'ParentColor'#8#14'ParentShowHint'
-  +#9#7'Visible'#9#0#0#6'TPanel'#6'Panel1'#4'Left'#2#0#6'Height'#2'K'#3'Top'#3
-  +#168#1#5'Width'#3'I'#2#11'HelpContext'#2#0#5'Align'#7#8'alBottom'#9'Alignmen'
-  +'t'#7#8'taCenter'#8'AutoSize'#8#18'BorderSpacing.Left'#2#0#17'BorderSpacing.'
-  +'Top'#2#0#19'BorderSpacing.Right'#2#0#20'BorderSpacing.Bottom'#2#0#20'Border'
-  +'Spacing.Around'#2#0'!BorderSpacing.CellAlignHorizontal'#7#7'ccaFill'#31'Bor'
-  +'derSpacing.CellAlignVertical'#7#7'ccaFill'#10'BevelInner'#7#6'bvNone'#10'Be'
-  +'velOuter'#7#8'bvRaised'#10'BevelWidth'#2#1#11'BorderWidth'#2#0#11'BorderSty'
-  +'le'#7#6'bsNone'#28'ChildSizing.LeftRightSpacing'#2#0#28'ChildSizing.TopBott'
-  +'omSpacing'#2#0#29'ChildSizing.HorizontalSpacing'#2#0#27'ChildSizing.Vertica'
-  +'lSpacing'#2#0#27'ChildSizing.ControlsPerLine'#2#0#12'ClientHeight'#2'K'#11
-  +'ClientWidth'#3'I'#2#8'DockSite'#8#10'DragCursor'#7#6'crDrag'#8'DragKind'#7#6
-  +'dkDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#11'FullRepaint'#9#11'ParentC'
-  +'olor'#9#10'ParentFont'#9#14'ParentShowHint'#9#8'TabOrder'#2#0#7'TabStop'#8#7
-  +'Visible'#9#0#6'TLabel'#6'lblAdd'#4'Left'#2#13#6'Height'#2#18#3'Top'#2#10#5
-  +'Width'#2#30#11'HelpContext'#2#0#5'Align'#7#6'alNone'#9'Alignment'#7#13'taLe'
-  +'ftJustify'#8'AutoSize'#9#18'BorderSpacing.Left'#2#0#17'BorderSpacing.Top'#2
-  +#0#19'BorderSpacing.Right'#2#0#20'BorderSpacing.Bottom'#2#0#20'BorderSpacing'
-  +'.Around'#2#0'!BorderSpacing.CellAlignHorizontal'#7#7'ccaFill'#31'BorderSpac'
-  +'ing.CellAlignVertical'#7#7'ccaFill'#7'Caption'#6#4'Add:'#10'DragCursor'#7#6
-  +'crDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#6'Layout'#7#5'tlTop'#14'Pare'
-  +'ntBidiMode'#9#11'ParentColor'#8#10'ParentFont'#9#14'ParentShowHint'#9#13'Sh'
-  +'owAccelChar'#9#11'Transparent'#9#7'Visible'#9#8'WordWrap'#8#11'OptimalFill'
-  +#8#0#0#6'TLabel'#7'lblAdd1'#4'Left'#2#13#6'Height'#2#18#3'Top'#2'*'#5'Width'
-  +#2'&'#11'HelpContext'#2#0#5'Align'#7#6'alNone'#9'Alignment'#7#13'taLeftJusti'
-  +'fy'#8'AutoSize'#9#18'BorderSpacing.Left'#2#0#17'BorderSpacing.Top'#2#0#19'B'
-  +'orderSpacing.Right'#2#0#20'BorderSpacing.Bottom'#2#0#20'BorderSpacing.Aroun'
-  +'d'#2#0'!BorderSpacing.CellAlignHorizontal'#7#7'ccaFill'#31'BorderSpacing.Ce'
-  +'llAlignVertical'#7#7'ccaFill'#7'Caption'#6#6'Clear:'#10'DragCursor'#7#6'crD'
-  +'rag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#6'Layout'#7#5'tlTop'#14'ParentB'
-  ,'idiMode'#9#11'ParentColor'#8#10'ParentFont'#9#14'ParentShowHint'#9#13'ShowA'
-  +'ccelChar'#9#11'Transparent'#9#7'Visible'#9#8'WordWrap'#8#11'OptimalFill'#8#0
-  +#0#7'TButton'#9'btnAddPie'#4'Left'#2'@'#6'Height'#2#25#3'Top'#2#8#5'Width'#2
-  +'4'#11'HelpContext'#2#0#5'Align'#7#6'alNone'#8'AutoSize'#8#18'BorderSpacing.'
-  +'Left'#2#0#17'BorderSpacing.Top'#2#0#19'BorderSpacing.Right'#2#0#20'BorderSp'
-  +'acing.Bottom'#2#0#20'BorderSpacing.Around'#2#0#25'BorderSpacing.InnerBorder'
-  +#2#4'!BorderSpacing.CellAlignHorizontal'#7#7'ccaFill'#31'BorderSpacing.CellA'
-  +'lignVertical'#7#7'ccaFill'#6'Cancel'#8#7'Caption'#6#3'Pie'#7'Default'#8#10
-  +'DragCursor'#7#6'crDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#14'ParentBid'
-  +'iMode'#9#11'ModalResult'#2#0#7'OnClick'#7#14'btnAddPieClick'#10'ParentFont'
-  +#9#14'ParentShowHint'#9#8'TabOrder'#2#0#7'TabStop'#9#7'Visible'#9#0#0#7'TBut'
-  +'ton'#10'btnAddLine'#4'Left'#3#232#0#6'Height'#2#25#3'Top'#2#8#5'Width'#2'4'
-  +#11'HelpContext'#2#0#5'Align'#7#6'alNone'#8'AutoSize'#8#18'BorderSpacing.Lef'
-  +'t'#2#0#17'BorderSpacing.Top'#2#0#19'BorderSpacing.Right'#2#0#20'BorderSpaci'
-  +'ng.Bottom'#2#0#20'BorderSpacing.Around'#2#0#25'BorderSpacing.InnerBorder'#2
-  +#4'!BorderSpacing.CellAlignHorizontal'#7#7'ccaFill'#31'BorderSpacing.CellAli'
-  +'gnVertical'#7#7'ccaFill'#6'Cancel'#8#7'Caption'#6#4'Line'#7'Default'#8#10'D'
-  +'ragCursor'#7#6'crDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#14'ParentBidi'
-  +'Mode'#9#11'ModalResult'#2#0#7'OnClick'#7#15'btnAddLineClick'#10'ParentFont'
-  +#9#14'ParentShowHint'#9#8'TabOrder'#2#1#7'TabStop'#9#7'Visible'#9#0#0#7'TBut'
-  +'ton'#10'btnAddArea'#4'Left'#2'x'#6'Height'#2#25#3'Top'#2#8#5'Width'#2'4'#11
-  +'HelpContext'#2#0#5'Align'#7#6'alNone'#8'AutoSize'#8#18'BorderSpacing.Left'#2
-  +#0#17'BorderSpacing.Top'#2#0#19'BorderSpacing.Right'#2#0#20'BorderSpacing.Bo'
-  +'ttom'#2#0#20'BorderSpacing.Around'#2#0#25'BorderSpacing.InnerBorder'#2#4'!B'
-  +'orderSpacing.CellAlignHorizontal'#7#7'ccaFill'#31'BorderSpacing.CellAlignVe'
-  +'rtical'#7#7'ccaFill'#6'Cancel'#8#7'Caption'#6#4'Area'#7'Default'#8#10'DragC'
-  +'ursor'#7#6'crDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#14'ParentBidiMode'
-  +#9#11'ModalResult'#2#0#7'OnClick'#7#15'btnAddAreaClick'#10'ParentFont'#9#14
-  +'ParentShowHint'#9#8'TabOrder'#2#2#7'TabStop'#9#7'Visible'#9#0#0#7'TButton'#9
-  +'btnAddBar'#4'Left'#3#176#0#6'Height'#2#25#3'Top'#2#8#5'Width'#2'4'#11'HelpC'
-  +'ontext'#2#0#5'Align'#7#6'alNone'#8'AutoSize'#8#18'BorderSpacing.Left'#2#0#17
-  +'BorderSpacing.Top'#2#0#19'BorderSpacing.Right'#2#0#20'BorderSpacing.Bottom'
-  +#2#0#20'BorderSpacing.Around'#2#0#25'BorderSpacing.InnerBorder'#2#4'!BorderS'
-  +'pacing.CellAlignHorizontal'#7#7'ccaFill'#31'BorderSpacing.CellAlignVertical'
-  +#7#7'ccaFill'#6'Cancel'#8#7'Caption'#6#3'Bar'#7'Default'#8#10'DragCursor'#7#6
-  +'crDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#14'ParentBidiMode'#9#11'Moda'
-  +'lResult'#2#0#7'OnClick'#7#14'btnAddBarClick'#10'ParentFont'#9#14'ParentShow'
-  +'Hint'#9#8'TabOrder'#2#3#7'TabStop'#9#7'Visible'#9#0#0#9'TCheckBox'#8'cbLege'
-  +'nd'#4'Left'#3#152#1#6'Height'#2#22#3'Top'#2#8#5'Width'#2'G'#11'HelpContext'
-  +#2#0#5'Align'#7#6'alNone'#11'AllowGrayed'#8#8'AutoSize'#9#18'BorderSpacing.L'
-  +'eft'#2#0#17'BorderSpacing.Top'#2#0#19'BorderSpacing.Right'#2#0#20'BorderSpa'
-  +'cing.Bottom'#2#0#20'BorderSpacing.Around'#2#0'!BorderSpacing.CellAlignHoriz'
-  +'ontal'#7#7'ccaFill'#31'BorderSpacing.CellAlignVertical'#7#7'ccaFill'#7'Capt'
-  +'ion'#6#6'Legend'#7'Checked'#8#10'DragCursor'#7#6'crDrag'#8'DragKind'#7#6'dk'
-  +'Drag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#8'OnChange'#7#14'cbLegendChang'
-  +'e'#11'ParentColor'#9#10'ParentFont'#9#14'ParentShowHint'#9#14'ParentBidiMod'
-  +'e'#9#5'State'#7#11'cbUnchecked'#8'TabOrder'#2#4#7'TabStop'#9#11'UseOnChange'
-  +#8#7'Visible'#9#0#0#9'TCheckBox'#12'cbBottomAxis'#4'Left'#3#152#1#6'Height'#2
-  +#22#3'Top'#2#24#5'Width'#2'f'#11'HelpContext'#2#0#5'Align'#7#6'alNone'#11'Al'
-  +'lowGrayed'#8#8'AutoSize'#9#18'BorderSpacing.Left'#2#0#17'BorderSpacing.Top'
-  +#2#0#19'BorderSpacing.Right'#2#0#20'BorderSpacing.Bottom'#2#0#20'BorderSpaci'
-  +'ng.Around'#2#0'!BorderSpacing.CellAlignHorizontal'#7#7'ccaFill'#31'BorderSp'
-  +'acing.CellAlignVertical'#7#7'ccaFill'#7'Caption'#6#11'Bottom Axis'#7'Checke'
-  +'d'#9#10'DragCursor'#7#6'crDrag'#8'DragKind'#7#6'dkDrag'#8'DragMode'#7#8'dmM'
-  +'anual'#7'Enabled'#9#8'OnChange'#7#18'cbBottomAxisChange'#11'ParentColor'#9
-  +#10'ParentFont'#9#14'ParentShowHint'#9#14'ParentBidiMode'#9#5'State'#7#9'cbC'
-  +'hecked'#8'TabOrder'#2#5#7'TabStop'#9#11'UseOnChange'#8#7'Visible'#9#0#0#9'T'
-  +'CheckBox'#10'cbLeftAxis'#4'Left'#3#152#1#6'Height'#2#22#3'Top'#2'('#5'Width'
-  +#2'N'#11'HelpContext'#2#0#5'Align'#7#6'alNone'#11'AllowGrayed'#8#8'AutoSize'
-  +#9#18'BorderSpacing.Left'#2#0#17'BorderSpacing.Top'#2#0#19'BorderSpacing.Rig'
-  +'ht'#2#0#20'BorderSpacing.Bottom'#2#0#20'BorderSpacing.Around'#2#0'!BorderSp'
-  +'acing.CellAlignHorizontal'#7#7'ccaFill'#31'BorderSpacing.CellAlignVertical'
-  +#7#7'ccaFill'#7'Caption'#6#9'Left Axis'#7'Checked'#9#10'DragCursor'#7#6'crDr'
-  +'ag'#8'DragKind'#7#6'dkDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#8'OnChan'
-  ,'ge'#7#16'cbLeftAxisChange'#11'ParentColor'#9#10'ParentFont'#9#14'ParentShow'
-  +'Hint'#9#14'ParentBidiMode'#9#5'State'#7#9'cbChecked'#8'TabOrder'#2#6#7'TabS'
-  +'top'#9#11'UseOnChange'#8#7'Visible'#9#0#0#9'TCheckBox'#7'cbTitle'#4'Left'#3
-  +#240#1#6'Height'#2#22#3'Top'#2#8#5'Width'#2'2'#11'HelpContext'#2#0#5'Align'#7
-  +#6'alNone'#11'AllowGrayed'#8#8'AutoSize'#9#18'BorderSpacing.Left'#2#0#17'Bor'
-  +'derSpacing.Top'#2#0#19'BorderSpacing.Right'#2#0#20'BorderSpacing.Bottom'#2#0
-  +#20'BorderSpacing.Around'#2#0'!BorderSpacing.CellAlignHorizontal'#7#7'ccaFil'
-  +'l'#31'BorderSpacing.CellAlignVertical'#7#7'ccaFill'#7'Caption'#6#5'Title'#7
-  +'Checked'#9#10'DragCursor'#7#6'crDrag'#8'DragKind'#7#6'dkDrag'#8'DragMode'#7
-  +#8'dmManual'#7'Enabled'#9#8'OnChange'#7#13'cbTitleChange'#11'ParentColor'#9
-  +#10'ParentFont'#9#14'ParentShowHint'#9#14'ParentBidiMode'#9#5'State'#7#9'cbC'
-  +'hecked'#8'TabOrder'#2#7#7'TabStop'#9#11'UseOnChange'#8#7'Visible'#9#0#0#9'T'
-  +'CheckBox'#8'cbFooter'#4'Left'#3#240#1#6'Height'#2#22#3'Top'#2#24#5'Width'#2
-  +'A'#11'HelpContext'#2#0#5'Align'#7#6'alNone'#11'AllowGrayed'#8#8'AutoSize'#9
-  +#18'BorderSpacing.Left'#2#0#17'BorderSpacing.Top'#2#0#19'BorderSpacing.Right'
-  +#2#0#20'BorderSpacing.Bottom'#2#0#20'BorderSpacing.Around'#2#0'!BorderSpacin'
-  +'g.CellAlignHorizontal'#7#7'ccaFill'#31'BorderSpacing.CellAlignVertical'#7#7
-  +'ccaFill'#7'Caption'#6#6'Footer'#7'Checked'#8#10'DragCursor'#7#6'crDrag'#8'D'
-  +'ragKind'#7#6'dkDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#8'OnChange'#7#14
-  +'cbFooterChange'#11'ParentColor'#9#10'ParentFont'#9#14'ParentShowHint'#9#14
-  +'ParentBidiMode'#9#5'State'#7#11'cbUnchecked'#8'TabOrder'#2#8#7'TabStop'#9#11
-  +'UseOnChange'#8#7'Visible'#9#0#0#9'TCheckBox'#10'cbInverted'#4'Left'#3#240#1
-  +#6'Height'#2#22#3'Top'#2'('#5'Width'#2'L'#11'HelpContext'#2#0#5'Align'#7#6'a'
-  +'lNone'#11'AllowGrayed'#8#8'AutoSize'#9#18'BorderSpacing.Left'#2#0#17'Border'
-  +'Spacing.Top'#2#0#19'BorderSpacing.Right'#2#0#20'BorderSpacing.Bottom'#2#0#20
-  +'BorderSpacing.Around'#2#0'!BorderSpacing.CellAlignHorizontal'#7#7'ccaFill'
-  +#31'BorderSpacing.CellAlignVertical'#7#7'ccaFill'#7'Caption'#6#8'Inverted'#7
-  +'Checked'#8#10'DragCursor'#7#6'crDrag'#8'DragKind'#7#6'dkDrag'#8'DragMode'#7
-  +#8'dmManual'#7'Enabled'#9#8'OnChange'#7#16'cbInvertedChange'#11'ParentColor'
-  +#9#10'ParentFont'#9#14'ParentShowHint'#9#14'ParentBidiMode'#9#5'State'#7#11
-  +'cbUnchecked'#8'TabOrder'#2#9#7'TabStop'#9#11'UseOnChange'#8#7'Visible'#9#0#0
-  +#7'TButton'#11'btnClearBar'#4'Left'#3#176#0#6'Height'#2#25#3'Top'#2'('#5'Wid'
-  +'th'#2'4'#11'HelpContext'#2#0#5'Align'#7#6'alNone'#8'AutoSize'#8#18'BorderSp'
-  +'acing.Left'#2#0#17'BorderSpacing.Top'#2#0#19'BorderSpacing.Right'#2#0#20'Bo'
-  +'rderSpacing.Bottom'#2#0#20'BorderSpacing.Around'#2#0#25'BorderSpacing.Inner'
-  +'Border'#2#4'!BorderSpacing.CellAlignHorizontal'#7#7'ccaFill'#31'BorderSpaci'
-  +'ng.CellAlignVertical'#7#7'ccaFill'#6'Cancel'#8#7'Caption'#6#3'Bar'#7'Defaul'
-  +'t'#8#10'DragCursor'#7#6'crDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#14'P'
-  +'arentBidiMode'#9#11'ModalResult'#2#0#7'OnClick'#7#16'btnClearBarClick'#10'P'
-  +'arentFont'#9#14'ParentShowHint'#9#8'TabOrder'#2#10#7'TabStop'#9#7'Visible'#9
-  +#0#0#7'TButton'#12'btnClearArea'#4'Left'#2'x'#6'Height'#2#25#3'Top'#2'('#5'W'
-  +'idth'#2'4'#11'HelpContext'#2#0#5'Align'#7#6'alNone'#8'AutoSize'#8#18'Border'
-  +'Spacing.Left'#2#0#17'BorderSpacing.Top'#2#0#19'BorderSpacing.Right'#2#0#20
-  +'BorderSpacing.Bottom'#2#0#20'BorderSpacing.Around'#2#0#25'BorderSpacing.Inn'
-  +'erBorder'#2#4'!BorderSpacing.CellAlignHorizontal'#7#7'ccaFill'#31'BorderSpa'
-  +'cing.CellAlignVertical'#7#7'ccaFill'#6'Cancel'#8#7'Caption'#6#4'Area'#7'Def'
-  +'ault'#8#10'DragCursor'#7#6'crDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#14
-  +'ParentBidiMode'#9#11'ModalResult'#2#0#7'OnClick'#7#17'btnClearAreaClick'#10
-  +'ParentFont'#9#14'ParentShowHint'#9#8'TabOrder'#2#11#7'TabStop'#9#7'Visible'
-  +#9#0#0#7'TButton'#12'btnClearLine'#4'Left'#3#232#0#6'Height'#2#25#3'Top'#2'('
-  +#5'Width'#2'4'#11'HelpContext'#2#0#5'Align'#7#6'alNone'#8'AutoSize'#8#18'Bor'
-  +'derSpacing.Left'#2#0#17'BorderSpacing.Top'#2#0#19'BorderSpacing.Right'#2#0
-  +#20'BorderSpacing.Bottom'#2#0#20'BorderSpacing.Around'#2#0#25'BorderSpacing.'
-  +'InnerBorder'#2#4'!BorderSpacing.CellAlignHorizontal'#7#7'ccaFill'#31'Border'
-  +'Spacing.CellAlignVertical'#7#7'ccaFill'#6'Cancel'#8#7'Caption'#6#4'Line'#7
-  +'Default'#8#10'DragCursor'#7#6'crDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9
-  +#14'ParentBidiMode'#9#11'ModalResult'#2#0#7'OnClick'#7#17'btnClearLineClick'
-  +#10'ParentFont'#9#14'ParentShowHint'#9#8'TabOrder'#2#12#7'TabStop'#9#7'Visib'
-  +'le'#9#0#0#7'TButton'#11'btnClearPie'#4'Left'#2'@'#6'Height'#2#25#3'Top'#2'('
-  +#5'Width'#2'4'#11'HelpContext'#2#0#5'Align'#7#6'alNone'#8'AutoSize'#8#18'Bor'
-  +'derSpacing.Left'#2#0#17'BorderSpacing.Top'#2#0#19'BorderSpacing.Right'#2#0
-  +#20'BorderSpacing.Bottom'#2#0#20'BorderSpacing.Around'#2#0#25'BorderSpacing.'
-  +'InnerBorder'#2#4'!BorderSpacing.CellAlignHorizontal'#7#7'ccaFill'#31'Border'
-  +'Spacing.CellAlignVertical'#7#7'ccaFill'#6'Cancel'#8#7'Caption'#6#3'Pie'#7'D'
-  ,'efault'#8#10'DragCursor'#7#6'crDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9
-  +#14'ParentBidiMode'#9#11'ModalResult'#2#0#7'OnClick'#7#16'btnClearPieClick'
-  +#10'ParentFont'#9#14'ParentShowHint'#9#8'TabOrder'#2#13#7'TabStop'#9#7'Visib'
-  +'le'#9#0#0#0#0
+  +'is.Grid.Visible'#9#18'BottomAxis.Visible'#9#28'BottomAxis.Title.Font.Height'
+  +#2#245#26'BottomAxis.Title.Font.Name'#6#13'MS Sans Serif'#21'BottomAxis.Grid'
+  +'.Color'#7#6'clGray'#21'BottomAxis.Grid.Style'#7#5'psDot'#23'BottomAxis.Grid'
+  +'.Visible'#9#13'Frame.Visible'#9#9'BackColor'#7#9'clBtnFace'#5'Align'#7#8'al'
+  +'Client'#5'Color'#7#9'clBtnFace'#11'ParentColor'#8#0#0#6'TPanel'#6'Panel1'#6
+  +'Height'#2'E'#3'Top'#3#174#1#5'Width'#3'I'#2#5'Align'#7#8'alBottom'#12'Clien'
+  +'tHeight'#2'E'#11'ClientWidth'#3'I'#2#8'TabOrder'#2#0#0#6'TLabel'#6'lblAdd'#4
+  +'Left'#2#13#6'Height'#2#14#3'Top'#2#10#5'Width'#2#24#7'Caption'#6#4'Add:'#11
+  +'ParentColor'#8#0#0#6'TLabel'#7'lblAdd1'#4'Left'#2#13#6'Height'#2#14#3'Top'#2
+  +'('#5'Width'#2#30#7'Caption'#6#6'Clear:'#11'ParentColor'#8#0#0#7'TButton'#9
+  +'btnAddPie'#4'Left'#2'0'#6'Height'#2#21#3'Top'#2#8#5'Width'#2'4'#25'BorderSp'
+  +'acing.InnerBorder'#2#4#7'Caption'#6#3'Pie'#7'OnClick'#7#14'btnAddPieClick'#8
+  +'TabOrder'#2#0#0#0#7'TButton'#10'btnAddLine'#4'Left'#3#216#0#6'Height'#2#21#3
+  +'Top'#2#8#5'Width'#2'4'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#4'Lin'
+  +'e'#7'OnClick'#7#15'btnAddLineClick'#8'TabOrder'#2#1#0#0#7'TButton'#10'btnAd'
+  +'dArea'#4'Left'#2'h'#6'Height'#2#21#3'Top'#2#8#5'Width'#2'4'#25'BorderSpacin'
+  +'g.InnerBorder'#2#4#7'Caption'#6#4'Area'#7'OnClick'#7#15'btnAddAreaClick'#8
+  +'TabOrder'#2#2#0#0#7'TButton'#9'btnAddBar'#4'Left'#3#160#0#6'Height'#2#21#3
+  +'Top'#2#8#5'Width'#2'4'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#3'Bar'
+  +#7'OnClick'#7#14'btnAddBarClick'#8'TabOrder'#2#3#0#0#9'TCheckBox'#8'cbLegend'
+  +#4'Left'#3#152#1#6'Height'#2#19#3'Top'#2#8#5'Width'#2'='#7'Caption'#6#6'Lege'
+  +'nd'#8'OnChange'#7#14'cbLegendChange'#8'TabOrder'#2#4#0#0#9'TCheckBox'#12'cb'
+  +'BottomAxis'#4'Left'#3#152#1#6'Height'#2#19#3'Top'#2#24#5'Width'#2'S'#7'Capt'
+  +'ion'#6#11'Bottom Axis'#7'Checked'#9#8'OnChange'#7#18'cbBottomAxisChange'#5
+  +'State'#7#9'cbChecked'#8'TabOrder'#2#5#0#0#9'TCheckBox'#10'cbLeftAxis'#4'Lef'
+  +'t'#3#152#1#6'Height'#2#19#3'Top'#2'('#5'Width'#2'D'#7'Caption'#6#9'Left Axi'
+  +'s'#7'Checked'#9#8'OnChange'#7#16'cbLeftAxisChange'#5'State'#7#9'cbChecked'#8
+  +'TabOrder'#2#6#0#0#9'TCheckBox'#7'cbTitle'#4'Left'#3#240#1#6'Height'#2#19#3
+  +'Top'#2#8#5'Width'#2'.'#7'Caption'#6#5'Title'#7'Checked'#9#8'OnChange'#7#13
+  +'cbTitleChange'#5'State'#7#9'cbChecked'#8'TabOrder'#2#7#0#0#9'TCheckBox'#8'c'
+  +'bFooter'#4'Left'#3#240#1#6'Height'#2#19#3'Top'#2#24#5'Width'#2':'#7'Caption'
+  +#6#6'Footer'#8'OnChange'#7#14'cbFooterChange'#8'TabOrder'#2#8#0#0#9'TCheckBo'
+  +'x'#10'cbInverted'#4'Left'#3#240#1#6'Height'#2#19#3'Top'#2'('#5'Width'#2'D'#7
+  +'Caption'#6#8'Inverted'#8'OnChange'#7#16'cbInvertedChange'#8'TabOrder'#2#9#0
+  +#0#7'TButton'#11'btnClearBar'#4'Left'#3#160#0#6'Height'#2#21#3'Top'#2'&'#5'W'
+  +'idth'#2'4'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#3'Bar'#7'OnClick'
+  +#7#16'btnClearBarClick'#8'TabOrder'#2#10#0#0#7'TButton'#12'btnClearArea'#4'L'
+  +'eft'#2'h'#6'Height'#2#21#3'Top'#2'&'#5'Width'#2'4'#25'BorderSpacing.InnerBo'
+  +'rder'#2#4#7'Caption'#6#4'Area'#7'OnClick'#7#17'btnClearAreaClick'#8'TabOrde'
+  +'r'#2#11#0#0#7'TButton'#12'btnClearLine'#4'Left'#3#216#0#6'Height'#2#21#3'To'
+  +'p'#2'&'#5'Width'#2'4'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#4'Line'
+  +#7'OnClick'#7#17'btnClearLineClick'#8'TabOrder'#2#12#0#0#7'TButton'#11'btnCl'
+  +'earPie'#4'Left'#2'0'#6'Height'#2#21#3'Top'#2'&'#5'Width'#2'4'#25'BorderSpac'
+  +'ing.InnerBorder'#2#4#7'Caption'#6#3'Pie'#7'OnClick'#7#16'btnClearPieClick'#8
+  +'TabOrder'#2#13#0#0#9'TSpinEdit'#10'edAddCount'#4'Left'#3'('#1#6'Height'#2#21
+  +#3'Top'#2#8#5'Width'#2'Z'#8'MaxValue'#4'@B'#15#0#8'MinValue'#2#1#8'TabOrder'
+  +#2#14#5'Value'#2#1#0#0#0#0
 ]);
Index: unit1.pas
===================================================================
--- unit1.pas	(revision 17399)
+++ unit1.pas	(working copy)
@@ -6,7 +6,7 @@
 
 uses
   Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
-  TAGraph, TASeries, Buttons, StdCtrls;
+  TAGraph, TASeries, Buttons, StdCtrls, Spin;
 
 type
   { TForm1 }
@@ -30,6 +30,7 @@
     lblAdd: TLabel;
     lblAdd1: TLabel;
     Panel1: TPanel;
+    edAddCount: TSpinEdit;
     procedure btnClearAreaClick(Sender: TObject);
     procedure btnClearBarClick(Sender: TObject);
     procedure btnClearLineClick(Sender: TObject);
@@ -64,45 +65,58 @@
 { TForm1 }
 
 procedure TForm1.btnAddAreaClick(Sender: TObject);
+var
+  i: integer;
 begin
   if FArea = nil then InitArea;
 
-  X3 := X3 + 1;
-  if random(2) >= 0.7 then Y3 := Y3 + random(5)
-  else if random(2) >= 0.7 then Y3 := 0
-  else Y3 := Y3 - random(5);
-  FArea.AddXY(x3, y3, '', clTAColor);
+  for i := 1 to edAddCount.Value do begin
+    X3 := X3 + 1;
+    if random(2) >= 0.7 then Y3 := Y3 + random(5)
+    else if random(2) >= 0.7 then Y3 := 0
+    else Y3 := Y3 - random(5);
+    FArea.AddXY(x3, y3, '', clTAColor);
+  end;
 end;
 
 procedure TForm1.btnAddBarClick(Sender: TObject);
+var
+  i: integer;
 begin
   if FBar = nil then InitBar;
-
-  FBar.AddXY(x, y, '', clRed);
-  X := X + 1;
-  if random(2) >= 0.7 then Y := Y + random(5)
-  else if random(2) >= 0.7 then Y := 0
-  else Y := Y - random(5);
+  for i := 1 to edAddCount.Value do begin
+    FBar.AddXY(x, y, '', clRed);
+    X := X + 1;
+    if random(2) >= 0.7 then Y := Y + random(5)
+    else if random(2) >= 0.7 then Y := 0
+    else Y := Y - random(5);
+  end;
 end;
 
 procedure TForm1.btnAddLineClick(Sender: TObject);
+var
+  i: integer;
 begin
   if FLine = nil then InitLine;
-
-  FLine.AddXY(x1, y1, '', clGreen);
-  X1 := X1 + 1.5;
-  if random(2) >= 0.5 then Y1 := Y1 + random(10)
-  else Y1 := Y1 - random(5);
+  for i := 1 to edAddCount.Value do begin
+    FLine.AddXY(x1, y1, '', clGreen);
+    X1 := X1 + 1.5;
+    if random(2) >= 0.5 then Y1 := Y1 + random(10)
+    else Y1 := Y1 - random(5);
+  end;
 end;
 
 procedure TForm1.btnAddPieClick(Sender: TObject);
+var
+  i: integer;
 begin
   if FPie = nil then InitPie;
-
-  FPie.AddPie(3.4234235235, 'sde21312', clTAColor);
-  FPie.AddPie(0.2323, 'adassssssdddddd', clTAColor);
-  FPie.AddPie(30, 'filipe romao', clTAColor);
-  FPie.AddPie(40, '234eds sa', clTAColor);
+  for i := 1 to edAddCount.Value do begin
+    FPie.AddPie(3.4234235235, 'sde21312', clTAColor);
+    FPie.AddPie(0.2323, 'adassssssdddddd', clTAColor);
+    FPie.AddPie(30, 'filipe romao', clTAColor);
+    FPie.AddPie(40, '234eds sa', clTAColor);
+  end;
 end;
 
 procedure TForm1.btnClearAreaClick(Sender: TObject);
@@ -160,8 +174,8 @@
 begin
   FArea := TAreaSeries.Create(Chart1);
   Chart1.AddSerie(FArea);
-  FArea.SeriesColor := clred;
-  FArea.Stairs := true;
+  FArea.SeriesColor := clFuchsia;
+  //FArea.Stairs := true;
   FArea.InvertedStairs := false;
 end;
 

Alexander S. Klenin

2008-11-15 18:02

developer   ~0023381

Last edited: 2008-11-15 23:17

This issue duplicates http://bugs.freepascal.org/view.php?id=11723 , but IMO offers a better patch.

Luiz Americo

2008-11-16 04:11

developer   ~0023387

As a side note is good practice to put a const keyword in front of XLabel. See some notes at http://lazarusroad.blogspot.com/2008/11/effect-of-using-constant-parameter-for.html

Alexander S. Klenin

2008-11-16 10:14

developer   ~0023389

Yes, I know. TAChart code was in such a bad shape that I just could not fix everything at once ;-) Perhaps in some future patch I'll do this.

I wonder whether also adding const to a Double parameters is a good idea. I just checked, and FPC does not pass 'const double' by reference, despite the documentation saying it should.

Luiz Americo

2008-11-16 13:59

developer   ~0023394

Last edited: 2008-11-16 14:09

I already tested for double types snd really there's no difference in the produced code. See below. I will ask in fpc maillist.

EDIT: I already asked in fpc-pascal maillist but nobody replied: http://thread.gmane.org/gmane.comp.compilers.free-pascal.general/11192

I'll try the fpc-devel.

.section .text.n_p$asmconstparameter_byvalue$double
    .balign 16,0x90
.globl P$ASMCONSTPARAMETER_BYVALUE$DOUBLE
P$ASMCONSTPARAMETER_BYVALUE$DOUBLE:
# Temps allocated between ebp-8 and ebp-8
# [17] begin
    pushl %ebp
    movl %esp,%ebp
    subl $8,%esp
# Var V located at ebp+8
# Var i located at ebp-8
# [18] i := V;
    movl 8(%ebp),%eax
    movl %eax,-8(%ebp)
    movl 12(%ebp),%eax
    movl %eax,-4(%ebp)
# [19] DoIt(i);
    subl $8,%esp
    movl -8(%ebp),%eax
    movl %eax,(%esp)
    movl -4(%ebp),%eax
    movl %eax,4(%esp)
    call P$ASMCONSTPARAMETER_DOIT$DOUBLE
# [20] end;
    leave
    ret $8

.section .text.n_p$asmconstparameter_byreference$double
    .balign 16,0x90
.globl P$ASMCONSTPARAMETER_BYREFERENCE$DOUBLE
P$ASMCONSTPARAMETER_BYREFERENCE$DOUBLE:
# Temps allocated between ebp-8 and ebp-8
# [25] begin
    pushl %ebp
    movl %esp,%ebp
    subl $8,%esp
# Var V located at ebp+8
# Var i located at ebp-8
# [26] i := V;
    movl 8(%ebp),%eax
    movl %eax,-8(%ebp)
    movl 12(%ebp),%eax
    movl %eax,-4(%ebp)
# [27] DoIt(i);
    subl $8,%esp
    movl -8(%ebp),%eax
    movl %eax,(%esp)
    movl -4(%ebp),%eax
    movl %eax,4(%esp)
    call P$ASMCONSTPARAMETER_DOIT$DOUBLE
# [28] end;
    leave
    ret $8

Darius Blaszijk

2008-11-22 10:46

developer   ~0023483

Thanks for the patch

Issue History

Date Modified Username Field Change
2008-11-15 17:55 Alexander S. Klenin New Issue
2008-11-15 17:55 Alexander S. Klenin File Added: taseries_addxy_speedup.patch
2008-11-15 17:56 Alexander S. Klenin File Added: taseries_addxy_speedup_demo.patch
2008-11-15 18:02 Alexander S. Klenin Note Added: 0023381
2008-11-15 18:17 Darius Blaszijk Relationship added has duplicate 0011723
2008-11-15 18:58 Darius Blaszijk Status new => assigned
2008-11-15 18:58 Darius Blaszijk Assigned To => Darius Blaszijk
2008-11-15 23:17 Alexander S. Klenin Note Edited: 0023381
2008-11-16 04:11 Luiz Americo Note Added: 0023387
2008-11-16 10:14 Alexander S. Klenin Note Added: 0023389
2008-11-16 13:59 Luiz Americo Note Added: 0023394
2008-11-16 14:09 Luiz Americo Note Edited: 0023394
2008-11-22 10:46 Darius Blaszijk Fixed in Revision => 17504
2008-11-22 10:46 Darius Blaszijk Status assigned => resolved
2008-11-22 10:46 Darius Blaszijk Fixed in Version => 0.9.27 (SVN)
2008-11-22 10:46 Darius Blaszijk Resolution open => fixed
2008-11-22 10:46 Darius Blaszijk Note Added: 0023483
2008-11-26 15:04 Alexander S. Klenin Status resolved => closed