From d5ab80d754a6bf31b7000ce22a6a1ecc98310a40 Mon Sep 17 00:00:00 2001 From: wp_xyz Date: Fri, 4 Feb 2022 22:08:22 +0100 Subject: [PATCH] TAChart: Adapt TBoxAndWhiskerSeries.YDataLayout to changes in the YIndex* properties. --- components/tachart/tamultiseries.pas | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/components/tachart/tamultiseries.pas b/components/tachart/tamultiseries.pas index 55754cf67a..36e06bae05 100644 --- a/components/tachart/tamultiseries.pas +++ b/components/tachart/tamultiseries.pas @@ -129,6 +129,7 @@ type procedure SetYIndexCenter(AValue: Integer); procedure SetYIndexWhiskerMax(AValue: Integer); procedure SetYIndexWhiskerMin(AValue: Integer); + procedure UpdateYDataLayout; protected procedure GetLegendItems(AItems: TChartLegendItems); override; function GetSeriesColor: TColor; override; @@ -1405,6 +1406,7 @@ procedure TBoxAndWhiskerSeries.SetYIndexBoxMax(AValue: Integer); begin if FYIndexBoxMax = AValue then exit; FYIndexBoxMax := AValue; + UpdateYDataLayout; UpdateParentChart; end; @@ -1412,6 +1414,7 @@ procedure TBoxAndWhiskerSeries.SetYIndexBoxMin(AValue: Integer); begin if FYIndexBoxMin = AValue then exit; FYIndexBoxMin := AValue; + UpdateYDataLayout; UpdateParentChart; end; @@ -1419,6 +1422,7 @@ procedure TBoxAndWhiskerSeries.SetYIndexCenter(AValue: Integer); begin if FYIndexCenter = AValue then exit; FYIndexCenter := AValue; + UpdateYDataLayout; UpdateParentChart; end; @@ -1426,6 +1430,7 @@ procedure TBoxAndWhiskerSeries.SetYIndexWhiskerMax(AValue: Integer); begin if FYIndexWhiskerMax = AValue then exit; FYIndexWhiskerMax := AValue; + UpdateYDataLayout; UpdateParentChart; end; @@ -1433,6 +1438,7 @@ procedure TBoxAndWhiskerSeries.SetYIndexWhiskerMin(AValue: Integer); begin if FYIndexWhiskerMin = AValue then exit; FYIndexWhiskerMin := AValue; + UpdateYDataLayout; UpdateParentChart; end; @@ -1540,6 +1546,21 @@ begin end; end; +procedure TBoxAndWhiskerSeries.UpdateYDataLayout; +begin + if (FYIndexWhiskerMin = 0) and (FYIndexBoxMin = 1) and (FYIndexCenter = 2) and + (FYIndexBoxMax = 3) and (FYIndexWhiskerMax = 4) + then + FYDataLayout := bwlLegacy + else + if (FYIndexCenter = 0) and (FYIndexWhiskerMin = 1) and (FYIndexBoxMin = 2) and + (FYIndexBoxMax = 3) and (FYIndexWhiskerMax = 4) + then + FYDataLayout := bwlNormal + else + FYDataLayout := bwlCustom; +end; + { TOpenHighLowCloseSeries }