Generell working with charts

Hello,

 
I try to learn the way of working of the AdvCharts. I tried the code from the manuel, but it oes not work.
 
procedure TDLZanalyse.Button4Click(Sender: TObject);
var i: integer;
begin
   //Adds 20 Points with random value from 0 to 50 to the first Pane (0)
   //with the first Series (0)
   for i := 0 to 20 do begin
      AdvChartView.Panes[0].Series[0].AddSinglePoint(RandomRange(0, 50));
   end;
   //Set Range from 0 to 20
   AdvChartView.Panes[0].Range.RangeFrom := 0;
   AdvChartView.Panes[0].Range.RangeTo := 20;
   //Set Auto Display Range to arEnabled
   AdvChartView.Panes[0].Series[0].Autorange := arEnabled;
end;
 
If I press the button, nothing happens. I get no mistake but the diagramm is not painted.
 
1. Does someone has an idea?
Where can I find examples of working with the TAdvChart Kompponent?
 
Many thanks
Patrick

Please add AdvChartView.BeginUpdate / AdvChartView.EndUpdate around this code, i.e.:


var
  i: integer;
begin
   AdvChartView.BeginUpdate;
   //Adds 20 Points with random value from 0 to 50 to the first Pane (0)
   //with the first Series (0)
   for i := 0 to 20 do begin
      AdvChartView.Panes[0].Series[0].AddSinglePoint(Random(50));
   end;
   //Set Range from 0 to 20
   AdvChartView.Panes[0].Range.RangeFrom := 0;
   AdvChartView.Panes[0].Range.RangeTo := 20;
   //Set Auto Display Range to arEnabled
   AdvChartView.Panes[0].Series[0].Autorange := arEnabled;
   AdvChartView.EndUpdate;
end;