For example: I create a new application, add a TChart and create a new THorizontalBarSeries. I put the following in the main form's OnShow event:
Code: Select all
procedure TForm1.FormShow(Sender: TObject);
var
i : integer;
begin
Series1.AddArray([200,0,123,300,260,-100,650,400]);
Chart1.LeftAxis.Items.Clear;
for i := 0 to 7 do
begin
chart1.Leftaxis.Items.Add(i, 'test' + intToStr(i));
chart1.Leftaxis.Items[i].color := clRed;
writeln(chart1.Leftaxis.Items[i].Text);
end;
chart1.Repaint;
end;
Code: Select all
if i mod 2 = 0 then chart1.leftaxis.items.add(i, 'test' + intoToStr(i));
Just FYI, I'm using TeeChart Pro 7.01 for Delphi 5.0
Thanks,
Andrew