Ver Mensaje Individual
  #4  
Antiguo 06-05-2020
cloayza cloayza is offline
Miembro
 
Registrado: may 2003
Ubicación: San Pedro de la Paz, Chile
Posts: 947
Reputación: 25
cloayza Tiene un aura espectacularcloayza Tiene un aura espectacular
Estimado JoAnCa, puede aportar mas antecedentes, para intentar aportar en la solución de su problema.

Supuse que esta utilizando un DBChart...

De acuerdo a los pocos datos que entrega (Hacer filtro sobre tabla y mostrar barras en gráfico).

Mi ejercicio:

Base de datos: employe.fdb
Tablas:
Employee: Para mostrar antecedentes
Country: Con la que llenaré combobox y haré filtro sobre Employee

Código Delphi [-]
procedure TForm5.cboxCountryChange(Sender: TObject);
begin
     if cboxCountry.ItemIndex<=0 then
     begin
          Employee.Filtered:=false;
          //Si la linea siguiente no se refresca el gráfico...
          DBChart1.RefreshData;
          exit;
     end;

     Employee.Filtered:=false;
     Employee.Filter:=Format('JOB_COUNTRY=%s',[QuotedStr(cboxCountry.Text)]);
     Employee.Filtered:=true;

     //Si la linea siguiente no se refresca el gráfico...

     DBChart1.RefreshData;
end;

procedure TForm5.FormCreate(Sender: TObject);
begin
     cboxCountry.Items.Clear;
     Countrys.Open;
     cboxCountry.Items.Add('All Country');
     while not Country.Eof do
     begin
          cboxCountry.Items.Add(Country.FieldByName('COUNTRY').AsString);
          Country.Next;
     end;
end;



Saludos cordiales
Responder Con Cita