Page 1 of 1

Bar Serie question

Posted: Mon Feb 04, 2008 10:41 am
by 9336880
Hello,

How can I change the Yvalue of a bar (with the name of the bar as parameter)?

I have done :
Series1->AddBar(1, "Name", clTeeColor);

And I search something like :
Series1->YValues("Name") = 2;

And not :
Series1->YValues->Items[0] = 2;

Regards.

Posted: Mon Feb 04, 2008 11:48 am
by narcis
Hi lolo31,

Yes, you can do something like this:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Series1.AddBar(5, 'point1', clTeeColor);
  Series1.AddBar(6, 'point2', clTeeColor);
  Series1.AddBar(7, 'point3', clTeeColor);

  i:=Series1.Labels.IndexOfLabel('point2');

  Series1.YValue[i] := 10;
end;