Hi, I'm trying to create a basic Open High Low Close chart using TAChart, but I'm getting a RunError(201) on "tacustomsource.pas" line 433, aparently YList is not initialized.

Here's the lfm:

object Form1: TForm1
  Left = 364
  Height = 354
  Top = 255
  Width = 582
  Caption = 'Form1'
  ClientHeight = 354
  ClientWidth = 582
  OnShow = FormShow
  LCLVersion = '1.3'
  object Chart1: TChart
    Left = 0
    Height = 354
    Top = 0
    Width = 582
    AxisList = <
      item
        Minors = <>
        Title.LabelFont.Orientation = 900
      end
      item
        Alignment = calBottom
        Minors = <>
      end>
    Foot.Brush.Color = clBtnFace
    Foot.Font.Color = clBlue
    Title.Brush.Color = clBtnFace
    Title.Font.Color = clBlue
    Title.Text.Strings = (
      'TAChart'
    )
    Align = alClient
    ParentColor = False
    object Chart1OpenHighLowCloseSeries1: TOpenHighLowCloseSeries
    end
  end
end

And Here's the .pas

unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, TAGraph, TASources, TAIntervalSources,
  TAMultiSeries, Forms, Controls, Graphics, Dialogs,
  StrUtils, DateUtils, TACustomSeries;

type

  { TForm1 }

  TForm1 = class(TForm)
    Chart1: TChart;
    Chart1OpenHighLowCloseSeries1: TOpenHighLowCloseSeries;
    procedure FormShow(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }


procedure TForm1.FormShow(Sender: TObject);
var
  lCSV: TStringList;
  lLine: TStringList;
  I: Integer;
  lDate: TDate;
  lOpen: double;
  lHigh: double;
  lLow: double;
  lClose: double;
  lStr: string;
begin
  lCSV := TStringList.Create;
  lLine := TStringList.Create;
  DefaultFormatSettings.DateSeparator:='-';
  DefaultFormatSettings.ShortDateFormat:='D-MMM-Y';
  DefaultFormatSettings.ShortMonthNames[1] := 'Jan';
  DefaultFormatSettings.ShortMonthNames[2] := 'Feb';
  DefaultFormatSettings.ShortMonthNames[3] := 'Mar';
  DefaultFormatSettings.ShortMonthNames[4] := 'Apr';
  DefaultFormatSettings.ShortMonthNames[5] := 'May';
  DefaultFormatSettings.ShortMonthNames[6] := 'Jun';
  DefaultFormatSettings.ShortMonthNames[7] := 'Jul';
  DefaultFormatSettings.ShortMonthNames[8] := 'Aug';
  DefaultFormatSettings.ShortMonthNames[9] := 'Sep';
  DefaultFormatSettings.ShortMonthNames[10] := 'Oct';
  DefaultFormatSettings.ShortMonthNames[11] := 'Nov';
  DefaultFormatSettings.ShortMonthNames[12] := 'Dec';
  try
    lCSV.LoadFromFile('aapl.csv');
    for I := 0 to lCSV.Count - 1 do
    begin
      if I = 0 then
        continue;
      lLine.CommaText:= lCSV[I];
      lDate := ScanDateTime('d-mmm-y', lLine[0]);
      lOpen := StrToFloat(lLine[1]);
      lHigh := StrToFloat(lLine[2]);
      lLow := StrToFloat(lLine[3]);
      lClose := StrToFloat(lLine[4]);
Chart1OpenHighLowCloseSeries1.AddXOHLC(I, lOpen, lHigh, lLow, lClose, DateToStr(lDate));
    end;
  finally
    lLine.Free;
    lCSV.Free;
  end;
end;

end.

Also I attached the file "aapl.csv" I'm using to feed the data.

--
Leonardo M. Ramé
http://leonardorame.blogspot.com
Date,Open,High,Low,Close,Volume
10-Sep-14,98.01,101.11,97.76,101.00,100869587
9-Sep-14,99.08,103.08,96.14,97.99,189846255
8-Sep-14,99.30,99.31,98.05,98.36,46356742
5-Sep-14,98.80,99.39,98.31,98.97,58457035
4-Sep-14,98.85,100.09,97.79,98.12,85718221
3-Sep-14,103.10,103.20,98.58,98.94,125420521
2-Sep-14,103.06,103.74,102.72,103.30,53564262
29-Aug-14,102.86,102.90,102.20,102.50,44595247
28-Aug-14,102.13,102.78,101.56,102.25,68459801
27-Aug-14,101.02,102.57,100.70,102.13,52369011
26-Aug-14,101.42,101.50,100.86,100.89,33151984
25-Aug-14,101.79,102.17,101.28,101.54,40270173
22-Aug-14,100.29,101.47,100.19,101.32,44183834
21-Aug-14,100.57,100.94,100.11,100.58,33478198
20-Aug-14,100.44,101.09,99.95,100.57,52699192
19-Aug-14,99.41,100.68,99.32,100.53,69399270
18-Aug-14,98.49,99.37,97.98,99.16,47572413
15-Aug-14,97.90,98.19,96.86,97.98,48951331
14-Aug-14,97.33,97.57,96.80,97.50,28115566
13-Aug-14,96.15,97.24,96.04,97.24,31916439
12-Aug-14,96.04,96.88,95.61,95.97,33795352
11-Aug-14,95.27,96.08,94.84,95.99,36584844
8-Aug-14,94.26,94.82,93.28,94.74,41865193
7-Aug-14,94.93,95.95,94.10,94.48,46711179
6-Aug-14,94.75,95.48,94.71,94.96,38558342
5-Aug-14,95.36,95.68,94.36,95.12,55932663
4-Aug-14,96.37,96.58,95.17,95.59,39958144
1-Aug-14,94.90,96.62,94.81,96.13,48511286
31-Jul-14,97.16,97.45,95.33,95.60,56842647
30-Jul-14,98.44,98.70,97.67,98.15,33010001
29-Jul-14,99.33,99.44,98.25,98.38,43143095
28-Jul-14,97.82,99.24,97.55,99.02,55317689
25-Jul-14,96.85,97.84,96.64,97.67,43469117
24-Jul-14,97.04,97.32,96.42,97.03,45728843
23-Jul-14,95.42,97.88,95.17,97.19,92917719
22-Jul-14,94.68,94.89,94.12,94.72,55196597
21-Jul-14,94.99,95.00,93.72,93.94,39079002
18-Jul-14,93.62,94.74,93.02,94.43,49987593
17-Jul-14,95.03,95.28,92.57,93.09,57298243
16-Jul-14,96.97,97.10,94.74,94.78,53502415
15-Jul-14,96.80,96.85,95.03,95.32,45696176
14-Jul-14,95.86,96.89,95.65,96.45,42810155
11-Jul-14,95.36,95.89,94.86,95.22,34018228
10-Jul-14,93.76,95.55,93.52,95.04,39685552
9-Jul-14,95.44,95.95,94.76,95.39,36436440
8-Jul-14,96.27,96.80,93.92,95.35,65221678
7-Jul-14,94.14,95.99,94.10,95.97,56467939
3-Jul-14,93.67,94.10,93.20,94.03,22891753
2-Jul-14,93.86,94.06,93.09,93.48,28465073
1-Jul-14,93.52,94.07,93.13,93.52,38223477
30-Jun-14,92.10,93.72,92.09,92.93,49589028
27-Jun-14,90.82,92.00,90.77,91.98,64028803
26-Jun-14,90.37,91.05,89.80,90.90,32629359
25-Jun-14,90.21,90.70,89.65,90.36,36868541
24-Jun-14,90.75,91.74,90.19,90.28,39036087
23-Jun-14,91.32,91.62,90.60,90.83,43694391
20-Jun-14,91.85,92.55,90.90,90.91,100898066
19-Jun-14,92.29,92.30,91.34,91.86,35527686
18-Jun-14,92.27,92.29,91.35,92.18,33514108
17-Jun-14,92.31,92.70,91.80,92.08,29726347
16-Jun-14,91.51,92.75,91.45,92.20,35561270
13-Jun-14,92.20,92.44,90.88,91.28,54525280
12-Jun-14,94.04,94.12,91.90,92.29,54748791
11-Jun-14,94.13,94.76,93.47,93.86,45681114
10-Jun-14,94.73,95.05,93.57,94.25,62777042
9-Jun-14,92.70,93.88,91.75,93.70,75414804
6-Jun-14,92.84,93.04,92.07,92.22,87620911
5-Jun-14,92.31,92.77,91.80,92.48,75951141
4-Jun-14,91.06,92.56,90.87,92.12,83870521
3-Jun-14,89.78,91.25,89.75,91.08,73231620
2-Jun-14,90.57,90.69,88.93,89.81,92337903
30-May-14,91.14,92.02,89.84,90.43,141005137
29-May-14,89.69,90.98,89.68,90.77,94118633
28-May-14,89.43,89.98,89.11,89.14,78921885
27-May-14,87.98,89.41,87.95,89.38,87216605
23-May-14,86.75,87.82,86.64,87.73,58052491
22-May-14,86.66,87.12,86.30,86.75,50218945
21-May-14,86.26,86.67,86.01,86.62,49249914
20-May-14,86.36,86.63,85.82,86.39,58708986
19-May-14,85.41,86.76,85.33,86.37,79439024
16-May-14,84.09,85.36,83.63,85.36,69091834
15-May-14,84.96,85.23,84.01,84.12,57711731
14-May-14,84.63,85.34,84.53,84.84,41600846
13-May-14,84.57,84.93,84.39,84.82,39934594
12-May-14,83.93,84.81,83.91,84.69,53324677
9-May-14,83.51,83.75,82.90,83.65,72899498
8-May-14,84.04,84.92,83.77,84.00,57574363
7-May-14,85.04,85.33,83.96,84.62,70715988
6-May-14,85.97,86.34,84.92,84.92,93641373
5-May-14,84.31,85.86,84.29,85.85,71766758
2-May-14,84.62,84.89,84.24,84.65,47878572
1-May-14,84.57,84.97,83.77,84.50,61052418
30-Apr-14,84.66,85.63,84.26,84.30,114220883
29-Apr-14,84.82,85.14,84.22,84.62,84344673
28-Apr-14,81.83,85.11,81.79,84.87,167371680
25-Apr-14,80.65,81.71,80.57,81.71,97568814
24-Apr-14,81.17,81.43,80.10,81.11,189978082
23-Apr-14,75.58,75.88,74.92,74.96,98735259
22-Apr-14,75.47,75.98,75.21,75.96,50664453
21-Apr-14,75.05,76.02,74.85,75.88,45668931
17-Apr-14,74.29,75.39,74.17,74.99,71106721
16-Apr-14,74.01,74.44,73.45,74.14,53732994
15-Apr-14,74.32,74.52,73.05,73.99,66622577
14-Apr-14,74.56,74.59,73.89,74.53,51445177
11-Apr-14,74.14,74.69,73.88,74.23,67975012
10-Apr-14,75.81,76.03,74.74,74.78,59912818
9-Apr-14,74.66,75.78,74.57,75.76,51542722
8-Apr-14,75.03,75.16,74.10,74.78,60971883
7-Apr-14,75.43,75.84,74.56,74.78,72462530
4-Apr-14,77.12,77.14,75.80,75.97,68812485
3-Apr-14,77.34,77.50,76.81,76.97,40648111
2-Apr-14,77.48,77.64,77.18,77.51,45104871
1-Apr-14,76.82,77.41,76.68,77.38,50189685
31-Mar-14,77.03,77.26,76.56,76.68,42167188
28-Mar-14,76.90,76.99,76.32,76.69,50141063
27-Mar-14,77.14,77.36,76.45,76.78,55507676
26-Mar-14,78.07,78.43,76.98,77.11,74942224
25-Mar-14,77.36,77.96,77.08,77.86,70573356
24-Mar-14,76.92,77.21,76.44,77.03,88924871
21-Mar-14,75.99,76.25,75.19,76.12,93612169
20-Mar-14,75.70,76.10,75.34,75.53,52099537
19-Mar-14,76.04,76.61,75.57,75.89,56188958
18-Mar-14,75.13,76.00,75.03,75.91,52411863
17-Mar-14,75.39,75.71,75.12,75.25,49886074
14-Mar-14,75.54,75.84,74.71,74.96,59299492
13-Mar-14,76.78,77.09,75.59,75.81,64435609
12-Mar-14,76.36,76.76,76.00,76.66,50195460
11-Mar-14,76.49,76.96,76.08,76.58,70198849
10-Mar-14,75.48,76.19,75.48,75.85,44691430
7-Mar-14,75.87,76.00,75.15,75.78,55415241
6-Mar-14,76.11,76.35,75.44,75.82,46423111
5-Mar-14,75.85,76.39,75.59,76.05,50065519
4-Mar-14,75.86,76.09,75.40,75.89,64884834
3-Mar-14,74.77,75.81,74.69,75.39,59784494
28-Feb-14,75.58,76.11,74.59,75.18,93074653
27-Feb-14,73.88,75.54,73.72,75.38,75557321
26-Feb-14,74.80,75.00,73.66,73.91,69131286
25-Feb-14,75.63,75.65,74.43,74.58,58247350
24-Feb-14,74.74,75.70,74.63,75.36,72364950
21-Feb-14,76.11,76.37,74.94,75.04,69757247
20-Feb-14,76.14,76.71,75.57,75.88,76529103
19-Feb-14,77.82,78.13,76.34,76.77,78554420
18-Feb-14,78.00,78.74,77.94,78.00,65306248
14-Feb-14,77.50,78.00,77.32,77.71,68468036
13-Feb-14,76.38,77.84,76.31,77.78,76960156
12-Feb-14,76.71,77.08,76.18,76.56,77127064
11-Feb-14,75.80,76.82,75.64,76.57,70672252
10-Feb-14,74.09,76.00,74.00,75.57,86451022
7-Feb-14,74.48,74.70,73.91,74.24,93638601
6-Feb-14,72.87,73.36,72.54,73.22,64497223
5-Feb-14,72.37,73.61,72.32,73.23,82322156
4-Feb-14,72.26,72.78,71.82,72.68,94273543
3-Feb-14,71.80,72.53,71.33,71.65,100620772
31-Jan-14,70.74,71.65,70.51,71.51,116336444
30-Jan-14,71.79,72.36,70.96,71.40,169762789
29-Jan-14,71.99,72.48,71.23,71.54,125942796
28-Jan-14,72.68,73.57,71.72,72.36,266833581
27-Jan-14,78.58,79.26,77.96,78.64,144219152
24-Jan-14,79.14,79.37,77.82,78.01,108384437
23-Jan-14,78.56,79.50,77.83,79.45,100978346
22-Jan-14,78.70,79.61,78.26,78.79,95219334
21-Jan-14,77.28,78.58,77.20,78.44,82255544
17-Jan-14,78.78,78.87,77.13,77.24,108426689
16-Jan-14,79.27,79.55,78.81,79.18,57471330
15-Jan-14,79.07,80.03,78.81,79.62,98472619
14-Jan-14,76.89,78.10,76.81,78.06,83734371
13-Jan-14,75.70,77.50,75.70,76.53,94860843
10-Jan-14,77.12,77.26,75.87,76.13,76320664
9-Jan-14,78.11,78.12,76.48,76.65,69905199
8-Jan-14,76.97,77.94,76.96,77.64,64686685
7-Jan-14,77.76,77.99,76.85,77.15,79432766
6-Jan-14,76.78,78.11,76.23,77.70,103359151
3-Jan-14,78.98,79.10,77.20,77.28,98303870
2-Jan-14,79.38,79.58,78.86,79.02,58791957
31-Dec-13,79.17,80.18,79.14,80.15,55819372
30-Dec-13,79.64,80.01,78.90,79.22,63407722
27-Dec-13,80.55,80.63,79.93,80.01,56471317
26-Dec-13,81.16,81.36,80.48,80.56,51002035
24-Dec-13,81.41,81.70,80.86,81.10,41888735
23-Dec-13,81.14,81.53,80.39,81.44,125326831
20-Dec-13,77.91,78.80,77.83,78.43,109103435
19-Dec-13,78.38,78.57,77.68,77.78,80239369
18-Dec-13,78.21,78.78,76.97,78.68,141465807
17-Dec-13,79.39,79.92,79.05,79.28,57475649
16-Dec-13,79.37,80.38,79.29,79.64,70648452
13-Dec-13,80.34,80.41,79.10,79.20,83205283
12-Dec-13,80.38,80.76,80.00,80.08,65572318
11-Dec-13,81.01,81.57,79.96,80.19,89929693
10-Dec-13,80.52,81.13,80.17,80.79,69567610
9-Dec-13,80.14,81.37,80.13,80.92,80123533
6-Dec-13,80.83,80.96,79.94,80.00,86088352
5-Dec-13,81.81,82.16,80.92,81.13,111895315
4-Dec-13,80.79,81.31,80.12,80.71,94452666
3-Dec-13,79.76,80.91,79.67,80.90,112741734
2-Dec-13,79.71,80.62,78.69,78.75,118135885
29-Nov-13,78.50,79.76,78.26,79.44,79532215
27-Nov-13,76.62,78.00,76.20,77.99,90861841
26-Nov-13,74.87,76.59,74.86,76.20,100345728
25-Nov-13,74.43,75.12,74.43,74.82,57348403
22-Nov-13,74.22,74.59,74.08,74.26,55931232
21-Nov-13,73.94,74.46,73.38,74.45,65506861
20-Nov-13,74.18,74.35,73.48,73.57,48545798
19-Nov-13,74.15,74.77,74.00,74.22,52234707
18-Nov-13,75.00,75.31,74.03,74.09,61236224
15-Nov-13,75.23,75.58,74.93,75.00,79479764
14-Nov-13,74.69,75.61,74.55,75.45,70605087
13-Nov-13,74.00,74.61,73.85,74.38,49304927
12-Nov-13,73.95,74.85,73.86,74.29,51114651
11-Nov-13,74.28,74.52,73.49,74.15,56863303
8-Nov-13,73.51,74.45,73.23,74.37,69829543
7-Nov-13,74.23,74.74,73.20,73.21,65655100
6-Nov-13,74.88,74.98,74.03,74.42,55844152
5-Nov-13,74.94,75.56,74.71,75.06,66368071
4-Nov-13,74.44,75.26,74.12,75.25,61157033
1-Nov-13,74.86,74.97,73.69,74.29,68722304
31-Oct-13,75.00,75.36,74.47,74.67,68923785
30-Oct-13,74.23,75.36,73.86,74.98,88540697
29-Oct-13,76.61,77.04,73.51,73.81,158952115
28-Oct-13,75.58,75.86,74.74,75.70,137610123
25-Oct-13,75.90,76.18,75.02,75.14,84448133
24-Oct-13,75.00,76.07,74.64,75.99,96191095
23-Oct-13,74.14,75.10,74.14,74.99,78431122
22-Oct-13,75.20,75.49,72.58,74.27,133515753
21-Oct-13,73.11,74.90,73.07,74.48,99526945
18-Oct-13,72.28,72.75,72.24,72.70,72635570
17-Oct-13,71.43,72.11,71.38,72.07,63398335
16-Oct-13,71.54,71.79,71.32,71.59,62775013
15-Oct-13,71.07,71.71,70.79,71.24,80018603
14-Oct-13,69.98,71.08,69.91,70.86,65474542
11-Oct-13,69.57,70.55,69.31,70.40,66934938
10-Oct-13,70.19,70.34,69.58,69.95,69650490
9-Oct-13,69.23,69.68,68.33,69.51,75431216
8-Oct-13,69.99,70.09,68.65,68.71,72729006
7-Oct-13,69.51,70.38,69.34,69.68,78073107
4-Oct-13,69.12,69.23,68.37,69.00,64717380
3-Oct-13,70.07,70.34,68.68,69.06,80688503
2-Oct-13,69.38,70.26,69.11,69.94,72295902
1-Oct-13,68.35,69.88,68.34,69.71,88470655
30-Sep-13,68.18,68.81,67.77,68.11,65039408
27-Sep-13,69.11,69.24,68.67,68.96,57009729
26-Sep-13,69.43,69.79,69.13,69.46,59305183
25-Sep-13,69.89,69.95,68.78,68.79,79239167
24-Sep-13,70.70,70.78,69.69,69.87,91085743
23-Sep-13,70.87,70.99,68.94,70.09,190526525
20-Sep-13,68.29,68.36,66.57,66.77,174825322
19-Sep-13,67.24,67.98,67.04,67.47,101134712
18-Sep-13,66.17,66.62,65.81,66.38,114215304
17-Sep-13,63.99,65.67,63.93,65.05,99844773
16-Sep-13,65.86,65.94,63.89,64.30,137137665
13-Sep-13,67.05,67.40,66.39,66.41,74708438
12-Sep-13,66.93,67.91,66.57,67.53,101012471
--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to