DBChart in Delphi

How can fill the Datasource,dataset,Label,Y,Bar in DBchart(serieslist)
manually because my Query in the
design run time ?
Help me please ,.
hertantoAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
kretzschmarConnect With a Mentor Commented:
hi hertanto,

a sample how could it done

procedure TForm1.Button1Click(Sender: TObject);
var Bars : TBarSeries;
begin
  dbchart1.SeriesList.Clear;  //delete previous chart
  Bars := TBarSeries.Create(self); //Create a Bar-Serie
  Bars.ParentChart := DBchart1;    //Set The Parent
  Bars.DataSource := Query1;       //Set The Datsource
  //Assign the Fields, can be another order
  Bars.XLabelsSource := Query1.Fields[0].FieldName;
  Bars.XValues.ValueSource := Query1.Fields[1].FieldName;
  Bars.YValues.ValueSource := Query1.Fields[2].FieldName;
  //Set some other properties, must not be done
  Bars.AutoBarSize := True;
  Bars.XValues.Order := loAscending;
  Bars.Active := True;  //Set Active, show the chart
end;

meikl
0
All Courses

From novice to tech pro — start learning today.