~ubuntu-branches/ubuntu/saucy/lazarus/saucy

« back to all changes in this revision

Viewing changes to lcl/barchart.pp

  • Committer: Package Import Robot
  • Author(s): Paul Gevers, Abou Al Montacir, Bart Martens, Paul Gevers
  • Date: 2013-06-08 14:12:17 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20130608141217-7k0cy9id8ifcnutc
Tags: 1.0.8+dfsg-1
[ Abou Al Montacir ]
* New upstream major release and multiple maintenace release offering many
  fixes and new features marking a new milestone for the Lazarus development
  and its stability level.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_fixes_branch
* LCL changes:
  - LCL is now a normal package.
      + Platform independent parts of the LCL are now in the package LCLBase
      + LCL is automatically recompiled when switching the target platform,
        unless pre-compiled binaries for this target are already installed.
      + No impact on existing projects.
      + Linker options needed by LCL are no more added to projects that do
        not use the LCL package.
  - Minor changes in LCL basic classes behaviour
      + TCustomForm.Create raises an exception if a form resource is not
        found.
      + TNotebook and TPage: a new implementation of these classes was added.
      + TDBNavigator: It is now possible to have focusable buttons by setting
        Options = [navFocusableButtons] and TabStop = True, useful for
        accessibility and for devices with neither mouse nor touch screen.
      + Names of TControlBorderSpacing.GetSideSpace and GetSpace were swapped
        and are now consistent. GetSideSpace = Around + GetSpace.
      + TForm.WindowState=wsFullscreen was added
      + TCanvas.TextFitInfo was added to calculate how many characters will
        fit into a specified Width. Useful for word-wrapping calculations.
      + TControl.GetColorResolvingParent and
        TControl.GetRGBColorResolvingParent were added, simplifying the work
        to obtain the final color of the control while resolving clDefault
        and the ParentColor.
      + LCLIntf.GetTextExtentExPoint now has a good default implementation
        which works in any platform not providing a specific implementation.
        However, Widgetset specific implementation is better, when available.
      + TTabControl was reorganized. Now it has the correct class hierarchy
        and inherits from TCustomTabControl as it should.
  - New unit in the LCL:
      + lazdialogs.pas: adds non-native versions of various native dialogs,
        for example TLazOpenDialog, TLazSaveDialog, TLazSelectDirectoryDialog.
        It is used by widgetsets which either do not have a native dialog, or
        do not wish to use it because it is limited. These dialogs can also be
        used by user applications directly.
      + lazdeviceapis.pas: offers an interface to more hardware devices such
        as the accelerometer, GPS, etc. See LazDeviceAPIs
      + lazcanvas.pas: provides a TFPImageCanvas descendent implementing
        drawing in a LCL-compatible way, but 100% in Pascal.
      + lazregions.pas. LazRegions is a wholly Pascal implementation of
        regions for canvas clipping, event clipping, finding in which control
        of a region tree one an event should reach, for drawing polygons, etc.
      + customdrawncontrols.pas, customdrawndrawers.pas,
        customdrawn_common.pas, customdrawn_android.pas and
        customdrawn_winxp.pas: are the Lazarus Custom Drawn Controls -controls
        which imitate the standard LCL ones, but with the difference that they
        are non-native and support skinning.
  - New APIs added to the LCL to improve support of accessibility software
    such as screen readers.
* IDE changes:
  - Many improvments.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/New_IDE_features_since#v1.0_.282012-08-29.29
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes#IDE_Changes
* Debugger / Editor changes:
  - Added pascal sources and breakpoints to the disassembler
  - Added threads dialog.
* Components changes:
  - TAChart: many fixes and new features
  - CodeTool: support Delphi style generics and new syntax extensions.
  - AggPas: removed to honor free licencing. (Closes: Bug#708695)
[Bart Martens]
* New debian/watch file fixing issues with upstream RC release.
[Abou Al Montacir]
* Avoid changing files in .pc hidden directory, these are used by quilt for
  internal purpose and could lead to surprises during build.
[Paul Gevers]
* Updated get-orig-source target and it compinion script orig-tar.sh so that they
  repack the source file, allowing bug 708695 to be fixed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{  $Id: barchart.pp 30388 2011-04-19 18:34:50Z sekelsenmat $  }
 
2
{
 
3
 /***************************************************************************
 
4
                               chart.pp
 
5
                               --------
 
6
                 Component Library Extended Controls
 
7
 
 
8
 ***************************************************************************/
 
9
 
 
10
 *****************************************************************************
 
11
 *                                                                           *
 
12
 *  This file is part of the Lazarus Component Library (LCL)                 *
 
13
 *                                                                           *
 
14
 *  See the file COPYING.modifiedLGPL.txt, included in this distribution,    *
 
15
 *  for details about the copyright.                                         *
 
16
 *                                                                           *
 
17
 *  This program is distributed in the hope that it will be useful,          *
 
18
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
 
19
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     *
 
20
 *                                                                           *
 
21
 *****************************************************************************
 
22
 
 
23
  This unit is deprecated, because there is something better:
 
24
  package TAChartLazarusPkg.
 
25
 
 
26
  Author: Michael Van Canneyt
 
27
}
 
28
unit BarChart;
 
29
 
 
30
{$MODE ObjFPC}{$H+}
 
31
 
 
32
interface
 
33
 
 
34
uses
 
35
  Types, SysUtils, Classes, LCLProc, LCLIntf, LCLType, Controls, ExtCtrls, Graphics,
 
36
  Dialogs, db;
 
37
 
 
38
type
 
39
 
 
40
  TPosLabel=(plLeft, plCenter, plRight);
 
41
  TCustomBarChart = class;
 
42
  { TBar }
 
43
 
 
44
  TBar = class(TCollectionItem)
 
45
  private
 
46
    FColor: TColor;
 
47
    FSName: String;
 
48
    FValue: integer;
 
49
    procedure SetColor(const AValue: TColor);
 
50
    procedure SetSName(const AValue: String);
 
51
    procedure SetValue(const AValue: integer);
 
52
    procedure UpdateBarChart;
 
53
  protected
 
54
    function GetDisplayName: string; override;
 
55
  published
 
56
    property SName: String read FSName write SetSName;
 
57
    property Value: integer read FValue write SetValue;
 
58
    property Color: TColor read FColor write SetColor;
 
59
  end;
 
60
 
 
61
  { TBarChartItems }
 
62
 
 
63
  TBarChartItems = class(TCollection)
 
64
  private
 
65
    FBarChart: TCustomBarChart;
 
66
  protected
 
67
    function GetOwner: TPersistent; override;
 
68
  public
 
69
    constructor Create(BarChart: TCustomBarChart);
 
70
  end;
 
71
  
 
72
  { TCustomBarChart }
 
73
 
 
74
  TCustomBarChart = class(TPanel)
 
75
  private
 
76
    FUpdateCount: Integer;
 
77
    FBars: TCollection;
 
78
    FDepth: byte;
 
79
    FLabelPosition:TPosLabel;
 
80
    FIsPainting: Boolean;
 
81
    function GetBars: TCollection;
 
82
    function NormalizeScaleUnits(OldScale: Integer): Integer;
 
83
    procedure SetBars(const AValue: TCollection);
 
84
    procedure SetDepth(const AValue: byte);
 
85
    procedure SetLabelPosition(const AValue: TPosLabel);
 
86
  protected
 
87
    procedure Paint; override;
 
88
    class function GetControlClassDefaultSize: TSize; override;
 
89
    function RealGetText: TCaption; override;
 
90
  public
 
91
    constructor Create(AOwner: TComponent); override;
 
92
    destructor Destroy; override;
 
93
    procedure Clear;
 
94
    function AddBar(const SName: string; Value: integer; AColor: TColor): TBar;
 
95
    function GetBar(SId: integer): TBar;
 
96
    function BarCount: Integer;
 
97
    procedure BeginUpdate;
 
98
    procedure EndUpdate;
 
99
    procedure UpdateBarChart;
 
100
  published
 
101
    property Bars: TCollection read GetBars write SetBars;
 
102
    property Depth: byte read FDepth write SetDepth;
 
103
    property LabelPosition: TPosLabel read FLabelPosition write SetLabelPosition;
 
104
  end;
 
105
  
 
106
  
 
107
  { TBarChart
 
108
    Deprecated!
 
109
    Use package TAChartLazarusPkg instead. It has a compatible and better component.}
 
110
  
 
111
  TBarChart = class(TCustomBarChart)
 
112
  published
 
113
    property Align;
 
114
    property Alignment;
 
115
    property Anchors;
 
116
    property AutoSize;
 
117
    property BorderSpacing;
 
118
    property BevelInner;
 
119
    property BevelOuter;
 
120
    property BevelWidth;
 
121
    property BorderWidth;
 
122
    property BorderStyle;
 
123
    property Caption;
 
124
    property ClientHeight;
 
125
    property ClientWidth;
 
126
    property Color;
 
127
    property Constraints;
 
128
    property DragMode;
 
129
    property Enabled;
 
130
    property Font;
 
131
    property FullRepaint;
 
132
    property ParentColor;
 
133
    property ParentFont;
 
134
    property ParentShowHint;
 
135
    property PopupMenu;
 
136
    property ShowHint;
 
137
    property TabOrder;
 
138
    property TabStop;
 
139
    property Visible;
 
140
    property OnClick;
 
141
    property OnDblClick;
 
142
    property OnDragDrop;
 
143
    property OnDragOver;
 
144
    property OnEndDrag;
 
145
    property OnEnter;
 
146
    property OnExit;
 
147
    property OnMouseDown;
 
148
    property OnMouseMove;
 
149
    property OnMouseUp;
 
150
    property OnResize;
 
151
    property OnStartDrag;
 
152
  end deprecated; // use package TAChartLazarusPkg instead. It has a compatible and better component.
 
153
 
 
154
 
 
155
procedure Register;
 
156
 
 
157
procedure FillBarChart(BC: TBarChart; DS: TDataset;
 
158
  const LabelField, ValueField: String; AColor: TColor);
 
159
 
 
160
implementation
 
161
 
 
162
procedure Register;
 
163
begin
 
164
  {$WARNINGS off}
 
165
  RegisterComponents('Misc',[TBarChart]);
 
166
  {$WARNINGS on}
 
167
end;
 
168
 
 
169
procedure FillBarChart(BC: TBarChart; DS: TDataset;
 
170
  const LabelField, ValueField: String; AColor: TColor);
 
171
Var
 
172
  LF : TList;
 
173
  VF : TField;
 
174
  I : Integer;
 
175
  L : String;
 
176
begin
 
177
  VF:=DS.FieldByName(ValueField);
 
178
  LF:=TList.Create;
 
179
  Try
 
180
    DS.GetFieldList(LF,LabelField);
 
181
    With DS do
 
182
      begin
 
183
      While Not EOF do
 
184
        begin
 
185
        L:='';
 
186
        For I:=0 to LF.Count-1 do
 
187
          begin
 
188
          If L<>'' then
 
189
            L:=L+' ';
 
190
          L:=L+TField(LF[i]).AsString;
 
191
          end;
 
192
        BC.AddBar(L, VF.AsInteger, AColor);
 
193
        Next;
 
194
        end;
 
195
      end;
 
196
  Finally
 
197
    LF.Free;
 
198
  end;
 
199
end;
 
200
 
 
201
constructor TCustomBarChart.Create(AOwner: TComponent);
 
202
begin
 
203
  inherited Create(AOwner);
 
204
  FBars:=TBarChartItems.Create(Self);
 
205
  FDepth:=5;
 
206
  FLabelPosition:=plLeft;
 
207
  with GetControlClassDefaultSize do
 
208
    SetInitialBounds(0, 0, CX, CY);
 
209
end;
 
210
 
 
211
destructor TCustomBarChart.Destroy;
 
212
begin
 
213
  FBars.Destroy;
 
214
  inherited Destroy;
 
215
end;
 
216
 
 
217
function TCustomBarChart.AddBar(const SName: string; Value: Integer;
 
218
  AColor: TColor): TBar;
 
219
begin
 
220
  BeginUpdate;
 
221
  Try
 
222
    result:=TBar(FBars.Add);
 
223
    result.FsName:=SName;
 
224
    result.FValue:=Value;
 
225
    result.FColor:=AColor;
 
226
  finally
 
227
    EndUpdate;
 
228
  end;
 
229
end;
 
230
 
 
231
function TCustomBarChart.GetBar(SId: integer): TBar;
 
232
begin
 
233
  result:=TBar(FBars.FindItemID(SId));
 
234
end;
 
235
 
 
236
function TCustomBarChart.NormalizeScaleUnits(OldScale: Integer): Integer;
 
237
 
 
238
Var
 
239
  T: Integer;
 
240
 
 
241
begin
 
242
  Result:=OldScale;
 
243
  if Result<2 then
 
244
    Result:=2
 
245
  else if Result<=5 then
 
246
    Result:=5
 
247
  else if Result<=10 then
 
248
    Result:=10
 
249
  else
 
250
    begin
 
251
    T:=StrToInt(IntToStr(Result)[1])+1;
 
252
    repeat
 
253
      Result:=Result div 10;
 
254
      T:=T*10;
 
255
    until Result<10;
 
256
    Result:=T;
 
257
    end;
 
258
end;
 
259
 
 
260
function TCustomBarChart.GetBars: TCollection;
 
261
begin
 
262
  Result:=FBars;
 
263
end;
 
264
 
 
265
procedure TCustomBarChart.SetBars(const AValue: TCollection);
 
266
begin
 
267
  FBars.Assign(AValue);
 
268
end;
 
269
 
 
270
procedure TCustomBarChart.SetDepth(const AValue: byte);
 
271
begin
 
272
  if FDepth=AValue then exit;
 
273
  FDepth:=AValue;
 
274
  UpdateBarChart;
 
275
end;
 
276
 
 
277
procedure TCustomBarChart.SetLabelPosition(const AValue: TPosLabel);
 
278
begin
 
279
  if FLabelPosition=AValue then exit;
 
280
  FLabelPosition:=AValue;
 
281
  UpdateBarChart;
 
282
end;
 
283
 
 
284
procedure TCustomBarChart.Paint;
 
285
 
 
286
var
 
287
  i,k,j,h,w,h1,HMax,VMax: integer;
 
288
  bx,by:integer;
 
289
  NScaleLines : Integer;
 
290
  ScaleUnits  : Integer;
 
291
  PixelPerUnit: Double;
 
292
  BC          : Double;
 
293
  RBC         : Integer;
 
294
  BL   : Integer;
 
295
  m,z: integer;
 
296
  ts : TBar;
 
297
  s  : string;
 
298
  rc : TRect;
 
299
 
 
300
  procedure ScaleLine(dk: integer; const s: string);
 
301
 
 
302
  begin
 
303
    Canvas.MoveTo(hmax+dk+FDepth,h1);
 
304
    Canvas.LineTo(hmax+dk+FDepth,h1+h);
 
305
    Canvas.LineTo(hmax+dk,h1+FDepth+h);
 
306
    Canvas.LineTo(hmax+dk,h1+FDepth+h+2);
 
307
    Canvas.TextOut(HMax+dk-j,m,s);
 
308
  end;
 
309
 
 
310
begin
 
311
  FIsPainting := true;
 
312
  try
 
313
    inherited Paint;
 
314
  finally
 
315
    FIsPainting := false;
 
316
  end;
 
317
  bx:=GetSystemMetrics(SM_CXEDGE);
 
318
  by:=GetSystemMetrics(SM_CYEDGE);
 
319
  hmax:=10;
 
320
  vmax:=0;
 
321
  for i:=0 to FBars.Count-1 do
 
322
    begin
 
323
    ts:=TBar(FBars.Items[i]);
 
324
    k:=Canvas.TextWidth(ts.FsName);
 
325
    if k>hmax then
 
326
      Hmax:=k;
 
327
    if ts.FValue>vmax then
 
328
      vmax:=ts.FValue;
 
329
    end;
 
330
  HMax:=HMax+10;
 
331
  h1:=RoundToInt(1.5*Canvas.TextHeight('W'));
 
332
  h:=Height-2*h1-Fdepth;
 
333
  w:=Width-hmax-2*FDepth;
 
334
  Canvas.Pen.Color:=clBlack;
 
335
  Canvas.Pen.Width:=1;
 
336
  Canvas.Pen.Style:=psSolid;
 
337
  Canvas.Brush.Color:=clYellow;
 
338
  Canvas.Brush.Style:=bsSolid;
 
339
  Canvas.Polygon([Point(HMax,h1+FDepth),Point(HMax,h1+FDepth+h),Point(HMax+FDepth,h1+h),Point(HMax+FDepth,h1)]);
 
340
  Canvas.Brush.Color:=clWhite;
 
341
  Canvas.Polygon([Point(HMax,h1+FDepth+h),Point(HMax+w,h1+FDepth+h),Point(HMax+w+FDepth,h1+h),Point(HMax+FDepth,h1+h)]);
 
342
  Canvas.Brush.Color:=Color;
 
343
  Canvas.Rectangle(hmax+Fdepth,h1,hmax+w+FDepth,h1+h+1);
 
344
  Canvas.Pen.Width:=3;
 
345
  Canvas.MoveTo(hmax,h1+FDepth);
 
346
  Canvas.LineTo(hmax,h1+FDepth+h);
 
347
  Canvas.LineTo(hmax+w,h1+FDepth+h);
 
348
  Canvas.TextOut(bx,by,Caption);
 
349
  j:=Canvas.TextWidth(IntTostr(VMax));
 
350
  if VMax=0 then
 
351
     begin
 
352
     PixelPerUnit:=1;
 
353
     NscaleLines:=1;
 
354
     end
 
355
   else
 
356
     begin
 
357
     PixelPerUnit:=double(w-j-6) / VMax;
 
358
     NScaleLines:=(w-j-6) div (2*j);
 
359
     end;
 
360
  if NScaleLines=0 then
 
361
    ScaleUnits:=Vmax +1
 
362
  else
 
363
    ScaleUnits:=(Vmax div NScaleLines) +1;
 
364
  ScaleUnits:=NormalizeScaleUnits(ScaleUnits);
 
365
  if ScaleUnits=0 then
 
366
    NScaleLines:=1
 
367
  else
 
368
    NScaleLines:=VMax div ScaleUnits;
 
369
  Canvas.Pen.Color:=clGray;
 
370
  Canvas.Pen.Style:=psDot;
 
371
  Canvas.Pen.Width:=1;
 
372
  j:=j div 2;
 
373
  m:=h1+FDepth+h+2;
 
374
  if VMax=0 then
 
375
    begin
 
376
    k:=w div 2;
 
377
    ScaleLine(k,'0');
 
378
    end
 
379
  else
 
380
    Canvas.TextOut(HMax-j,m,'0');
 
381
  for k:=1 to NScaleLines do
 
382
    ScaleLine(RoundToInt(ScaleUnits*PixelPerUnit*k),IntToStr(k*ScaleUnits));
 
383
  If FBars.Count=0 then
 
384
    BC:=0
 
385
  else
 
386
    BC:=double(h) / (2*(FBars.Count+1));
 
387
  RBC:=RoundToInt(BC);
 
388
  z:=h1+FDepth+h;
 
389
  Canvas.Pen.Style:=psSolid;
 
390
  for i:=0 to FBars.Count-1 do
 
391
    begin
 
392
    ts:=TBar(FBars.Items[i]);
 
393
    z:=h1+FDepth+h-Round(2*(I+1)*BC);
 
394
    Canvas.Brush.Color:=ts.FColor;
 
395
    m:=ts.FValue;
 
396
    BL:=RoundToInt(m*PixelPerUnit);
 
397
    Canvas.Rectangle(hmax+1,z-1,hmax+BL+1,z+RBC-1);
 
398
    Canvas.Polygon([Point(hmax,z),Point(hmax+BL,z),Point(hmax+BL+FDepth,z-FDepth),Point(hmax+FDepth,z-FDepth)]);
 
399
    Canvas.Polygon([Point(hmax+BL,z),Point(hmax+BL,z+RBC-1),Point(hmax+BL+FDepth,z+RBC-1-FDepth),Point(hmax+BL+FDepth,z-FDepth)]);
 
400
    s:=IntToStr(m);
 
401
    w:=z+(RBC-FDepth) div 2;
 
402
    Canvas.MoveTo(Hmax+BL+Fdepth div 2,w);
 
403
    Canvas.LineTo(Hmax+BL+Fdepth+5-bx,w);
 
404
    Canvas.Brush.Color:=clYellow;
 
405
    with rc do
 
406
      begin
 
407
      left:=hmax+BL+FDepth+5-bx;
 
408
      right:=left+Canvas.TextWidth(s)+2*bx;
 
409
      top:=w-Canvas.TextHeight(s) div 2-by;
 
410
      bottom:=w+Canvas.TextHeight(s) div 2+by;
 
411
      end;
 
412
    Canvas.Rectangle(rc);
 
413
    //debugln('TCustomBarChart.Paint A ',dbgs(rc),' s="',s,'"');
 
414
    Canvas.TextOut(rc.Left+bx,rc.Top+by,s);
 
415
    Canvas.Font.Color:=Font.Color;
 
416
    case FLabelPosition of
 
417
      plLeft: Canvas.TextOut(bx,z,ts.FSName);
 
418
      plCenter: Canvas.TextOut(HMax+((BL-Canvas.TextWidth(ts.FSName)) div 2),z,ts.FSName);
 
419
      plRight: Canvas.TextOut(HMax+BL-Canvas.TextWidth(ts.FSName)-bx,z,ts.FSName);
 
420
    end;
 
421
    end;
 
422
  Canvas.Pen.Style:=psSolid;
 
423
end;
 
424
 
 
425
function TCustomBarChart.RealGetText: TCaption;
 
426
begin
 
427
  if FIsPainting then
 
428
    Result := ''
 
429
  else
 
430
    Result := inherited RealGetText;
 
431
end;
 
432
 
 
433
class function TCustomBarChart.GetControlClassDefaultSize: TSize;
 
434
begin
 
435
  Result.CX := 150;
 
436
  Result.CY := 120;
 
437
end;
 
438
 
 
439
procedure TCustomBarChart.Clear;
 
440
begin
 
441
  FBars.Clear;
 
442
end;
 
443
 
 
444
procedure TCustomBarChart.BeginUpdate;
 
445
begin
 
446
  Inc(FUpdateCount);
 
447
end;
 
448
 
 
449
procedure TCustomBarChart.EndUpdate;
 
450
begin
 
451
  if FUpdateCount=0 then
 
452
    raise Exception.Create('TCustomBarChart.EndUpdate');
 
453
  Dec(FUpdateCount);
 
454
  If FUpdateCount=0 then
 
455
    Invalidate;
 
456
end;
 
457
 
 
458
procedure TCustomBarChart.UpdateBarChart;
 
459
begin
 
460
  if FUpdateCount = 0 then
 
461
    Invalidate;
 
462
end;
 
463
 
 
464
function TCustomBarChart.BarCount: Integer;
 
465
begin
 
466
  Result:=FBars.Count;
 
467
end;
 
468
 
 
469
{ TBar }
 
470
 
 
471
procedure TBar.SetColor(const AValue: TColor);
 
472
begin
 
473
  if FColor=AValue then exit;
 
474
  FColor:=AValue;
 
475
  UpdateBarChart;
 
476
end;
 
477
 
 
478
procedure TBar.SetSName(const AValue: String);
 
479
begin
 
480
  if FSName=AValue then exit;
 
481
  FSName:=AValue;
 
482
  UpdateBarChart;
 
483
end;
 
484
 
 
485
procedure TBar.SetValue(const AValue: integer);
 
486
begin
 
487
  if FValue=AValue then exit;
 
488
  FValue:=AValue;
 
489
  UpdateBarChart;
 
490
end;
 
491
 
 
492
procedure TBar.UpdateBarChart;
 
493
begin
 
494
  (Collection as TBarChartItems).FBarChart.UpdateBarChart;
 
495
end;
 
496
 
 
497
function TBar.GetDisplayName: string;
 
498
begin
 
499
  Result:=FSName;
 
500
end;
 
501
 
 
502
{ TBarChartItems }
 
503
 
 
504
function TBarChartItems.GetOwner: TPersistent;
 
505
begin
 
506
  Result := FBarChart;
 
507
end;
 
508
 
 
509
constructor TBarChartItems.Create(BarChart: TCustomBarChart);
 
510
begin
 
511
  inherited Create(TBar);
 
512
  FBarChart:=BarChart;
 
513
end;
 
514
 
 
515
end.