Page 1 of 1

Bands don't display in grid

Posted: Fri Dec 02, 2016 12:49 am
by 16577368
In the attached (very simplified) demo of a project I am working on, I add bands to the chart when I load the data to the grid. Problem is, I don't know when I can add the bands: when I add the bands, I need value for Chart1.BottomAxis.Maximum. If I add the bands in OnBeforeDrawChart, Maximum is 0, if I add them in OnBeforeDrawSeries, the Maximum value is available but it is too late to show the bands until it is redrawn.

Any suggestions on how to get the attached demo to work?

Thank you,

Ed Dressel

Re: Bands don't display in grid

Posted: Fri Dec 02, 2016 8:54 am
by yeray
Hello,

Updating the Bands at OnBeforeDrawAxes seems to work for me:

Code: Select all

procedure TForm2.Chart1BeforeDrawAxes(Sender: TObject);
begin
  UpdateBands;
end;