Ver Mensaje Individual
  #1  
Antiguo 24-02-2011
ramonibk ramonibk is offline
Miembro
 
Registrado: may 2004
Posts: 193
Reputación: 23
ramonibk Va por buen camino
TChart en tiempo de Ejecucion

Buenas. primero y antetodo soy nuevo en esto de los Tchart y em programacion en jeneral. je,je,je.

la cuestion es que tengo un PageControl en el cul genero unos ttabsheet en tiempo de ejecucion sobre ellos genero un TChart y el problema surge cuando genero las Series en el TChar. la primera lo hace correctamente pero la sugunda vez lo que hace es eliminar el Series del primer TChart y pintar el primero y el segundo sobre el segundo Tchart.

aqui os pongo el codigo.
Código Delphi [-]
Var
 Grafica: tchart;
 Solapa:ttabsheet;
begin
     Solapa:=ttabsheet.Create(self);
     with Solapa do
       begin
        PageControl:=PageControl1;
        Caption := 'Nombre ' + IntToStr(i);
       end;

     Grafica:=tchart.Create(self);
     With  Grafica do
      Begin
       Grafica.Parent:=Solapa;
       Grafica.Name := Solapa.Name;
       Grafica.Left := 128;
       Grafica.Top := 0;
       Grafica.Width := 481;
       Grafica.Height := 333;
       Grafica.BackWall.Brush.Color := clWhite;
       Grafica.LeftWall.Brush.Color := clWhite;
       Grafica.Chart3DPercent := 100;
       Grafica.Legend.Alignment := laLeft;
       Grafica.Legend.ColorWidth := 10;
       Grafica.Legend.TextStyle := ltsPlain;
       Grafica.AddSeries(Series1); 
       Grafica.Series[1].Add(12,'Hola');
      End;
 Inc(i); // I Variable global iniciada a 0
end;

He intentado
Código Delphi [-]
       
   Grafica.AddSeries(Series[i]); 
   Grafica.Series[i].Add(12,'Hola');
Pero me da error "List Index Out of Bounds(0)"
Responder Con Cita