Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TMS VCL Chart
Updating Chart at runtime

When updating the chart component at runtime it is important to "tell" the chart to update itself.

Whenever you change properties, or add/remove points the chart will not be updated.
This is because the chart will be repainted over and over again every time you change a property.
This would cause a slow performance.

To update the chart at runtime, after you change properties, you must use the BeginUpdate / EndUpdate methods.

Sample: Updating a series of points at runtime
procedure TForm1.Button1Click(Sender: TObject);
begin
  AdvChartView1.BeginUpdate;
  with AdvChartView1.Panes[0].Series[0] do
  begin
    Points[0].SingleValue := 100;
    Points[1].SingleValue := 50;
    Points[2].SingleValue := 20;
    Points[3].SingleValue := 30;
    Points[4].SingleValue := 150;
    Points[5].SingleValue := 160;
  end;
  AdvChartView1.EndUpdate;
end;