mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-31 08:52:41 +02:00
TAChart: Add method GetAxisRange to determine the range of an axis covered by all series assigned to it.
git-svn-id: trunk@65384 -
This commit is contained in:
parent
2255df954a
commit
9d7566217a
@ -661,6 +661,11 @@ as a replacement.
|
||||
<element name="TChart.ScalingValid"><short>Indicates whether the scaling parameters for the conversion between graph and image coordinates have valid values.</short>
|
||||
</element><element name="TChart.ActiveToolIndex"><short>Returns the index of the currently active chart tool in the toolset attached to the chart.</short>
|
||||
</element>
|
||||
<element name="TChart.GetAxisBounds"/><element name="TChart.GetAxisRange"><short>Determines the data range covered by all series assigned to the specified axis. Minimum and maximum are returned in axis units.</short>
|
||||
</element><element name="TChart.MouseDown"><short>The inherited handler for MouseDown events is overridden to dispatch the event to the ChartToolset assigned to the chart.</short>
|
||||
</element><element name="TChart.MouseMove"><short>The inherited handler for MouseMove events is overridden to dispatch the event to the ChartToolset assigned to the chart.</short>
|
||||
</element><element name="TChart.MouseUp"><short>The inherited handler for MouseUp events is overridden to dispatch the event to the ChartToolset assigned to the chart.</short>
|
||||
</element>
|
||||
</module>
|
||||
</package>
|
||||
</fpdoc-descriptions>
|
||||
|
@ -441,13 +441,17 @@ function TCustomChartSeries.GetAxisBounds(AAxis: TChartAxis;
|
||||
out AMin, AMax: Double): Boolean;
|
||||
var
|
||||
ex: TDoubleRect;
|
||||
axIndexX, axIndexY: Integer;
|
||||
begin
|
||||
if (AAxis.Index = AxisIndexX) or (AAxis.Index = AxisIndexY) then begin
|
||||
axIndexX := GetAxisX.Index;
|
||||
axIndexY := GetAxisY.Index;
|
||||
|
||||
if (AAxis.Index = axIndexX) or (AAxis.Index = axIndexY) then begin
|
||||
ex := EmptyExtent;
|
||||
GetBounds(ex);
|
||||
with ex do begin
|
||||
UpdateBoundsByAxisRange(FChart.AxisList, AxisIndexX, a.X, b.X);
|
||||
UpdateBoundsByAxisRange(FChart.AxisList, AxisIndexY, a.Y, b.Y);
|
||||
UpdateBoundsByAxisRange(FChart.AxisList, axIndexX, a.X, b.X);
|
||||
UpdateBoundsByAxisRange(FChart.AxisList, axIndexY, a.Y, b.Y);
|
||||
if IsRotated then begin
|
||||
Exchange(a.X, a.Y);
|
||||
Exchange(b.X, b.Y);
|
||||
|
@ -352,6 +352,7 @@ type
|
||||
procedure Draw(ADrawer: IChartDrawer; const ARect: TRect);
|
||||
procedure DrawLegendOn(ACanvas: TCanvas; var ARect: TRect);
|
||||
procedure EnableRedrawing;
|
||||
procedure GetAxisRange(AAxis: TChartAxis; out AMin, AMax: Double);
|
||||
function GetFullExtent: TDoubleRect;
|
||||
function GetLegendItems(AIncludeHidden: Boolean = false): TChartLegendItems;
|
||||
procedure Notify(ACommand: Integer; AParam1, AParam2: Pointer; var AData); override;
|
||||
@ -1164,6 +1165,15 @@ begin
|
||||
Result := FAxisList.GetAxisByAlign(AAlign);
|
||||
end;
|
||||
|
||||
procedure TChart.GetAxisRange(AAxis: TChartAxis; out AMin, AMax: Double);
|
||||
var
|
||||
interval: TDoubleInterval;
|
||||
begin
|
||||
interval := GetAxisBounds(AAxis);
|
||||
AMin := interval.FStart;
|
||||
AMax := interval.FEnd;
|
||||
end;
|
||||
|
||||
function TChart.GetChartHeight: Integer;
|
||||
begin
|
||||
Result := FClipRect.Bottom - FClipRect.Top;
|
||||
|
Loading…
Reference in New Issue
Block a user