Board index » delphi » Changing Dataset of DBChart

Changing Dataset of DBChart

I have a DBChart linked to a database with three Query components to display
prices according to a selected code from a ComboBox. I'm trying to change
the Dataset of the Chart to correspond with the query being used. I'm trying
to do it in the following statement:

If DBComboBox1.Text = 'ASA' Then
  Begin
    DBGrid1.DataSource := DataSource2;
    DBNavigator1.DataSource := Datasource2;
    Query2.Active := True;

 end;

Any help would be appreciated,
Garry.

 

Re:Changing Dataset of DBChart


You should prepare the series in the dbChart and have something like that :

DBChart1.SeriesList.Series[0].Active := True;
DBChart1.SeriesList.Series[1].Active := False;

to switch between the displays.

Garry Shivers <ga...@edata.co.za> a crit dans le message :
941547068.359...@earth.adept.co.za...

Quote

> I have a DBChart linked to a database with three Query components to
display
> prices according to a selected code from a ComboBox. I'm trying to change
> the Dataset of the Chart to correspond with the query being used. I'm
trying
> to do it in the following statement:

> If DBComboBox1.Text = 'ASA' Then
>   Begin
>     DBGrid1.DataSource := DataSource2;
>     DBNavigator1.DataSource := Datasource2;
>     Query2.Active := True;

>  end;

> Any help would be appreciated,
> Garry.

Other Threads