If I understand correctly you want to know the range of the axes in a chart. The most flexible way, I think, is to use the function LogicalExtent of the Chart. This returns a rectangle defined by corner points a and b - a is the bottom/left corner, b the top/right corner of the area covered by the data. There is also a CurrentExtent which is very similar but includes also the margins around the data areas (property Chart.Margin). So, in otherwords
- Chart.LogicalExtent.a.x is the minimum x value of all series
- Chart.LogicalExtent.a.y is the minimum y value of all series
- Chart.LogicalExtent.b.x is the maximum x value of all series
- Chart.LogicalExtent.b.y is the maximum y value of all series.
- Chart.CurrentExtent.a.x is the minimum x value of all series minus the left chart margin (converted to "world" coordinates)
- etc.
You can also write to this property, and this way you force an axis to a specific limit. But the Extent is a record, and the chart does not provide a setter for the record elements; therefore you must set the entire Extent record using an intermediate variable. And note: Maximum must always be larger than Minimum!
Example
uses
TAChartUtils;
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
var
ex: TDoubleRect;
begin
ex := Chart2.LogicalExtent;
ex.b.y := Chart1.LogicalExtent.b.y;
Chart2.LogicalExtent := ex;
end;