Custom Label Colors
Posted: Thu Sep 22, 2005 9:24 pm
I think I must be missing something very simple here. I can't seem to change the colour of a custom label in my chart. I've checked the TeeChart Pro demo program, and I still can't figure it out.
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:
...all my labels are still black. Just to verify that it was displaying my custom lables, and not the automatic ones, I changed the add line to read
This results in every other line having a label, so obviously my custom labels are being displayed. Also, opening up a console window and writing the label text as above displays the proper text, so I'm indexing the labels properly when I try to set their colour. Why are they all black?
Just FYI, I'm using TeeChart Pro 7.01 for Delphi 5.0
Thanks,
Andrew
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