fpspreadsheet: Fix cooperation of changed TsWorkbookChartSource with TsWorkbookChartLink.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9047 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2023-11-27 18:17:22 +00:00
parent baf8abdc40
commit 2c6fbd54c5
2 changed files with 26 additions and 11 deletions

View File

@ -35,13 +35,13 @@ implementation
{$R *.lfm} {$R *.lfm}
const const
// FILE_NAME = '../../../other/chart/bars.ods'; FILE_NAME = '../../../other/chart/bars.ods';
// FILE_NAME = '../../../other/chart/area.ods'; // FILE_NAME = '../../../other/chart/area.ods';
// FILE_NAME = '../../../other/chart/area-sameImg.ods'; // FILE_NAME = '../../../other/chart/area-sameImg.ods';
// FILE_NAME = '../../../other/chart/pie.ods'; // FILE_NAME = '../../../other/chart/pie.ods';
// FILE_NAME = '../../../other/chart/scatter.ods'; // FILE_NAME = '../../../other/chart/scatter.ods';
// FILE_NAME = '../../../other/chart/regression.ods'; // FILE_NAME = '../../../other/chart/regression.ods';
FILE_NAME = '../../../other/chart/radar.ods'; // FILE_NAME = '../../../other/chart/radar.ods';
{ TForm1 } { TForm1 }

View File

@ -372,12 +372,26 @@ var
i: Integer; i: Integer;
value: Double; value: Double;
begin begin
for i := 0 to XCount-1 do
begin
if FRanges[rngX, i] <> nil then
begin
GetXYItem(rngX, i, AIndex, value, dummyString);
FCurItem.SetX(i, value);
end else
if FCyclicX then
value := AIndex / FPointsNumber * TWO_PI
else
value := AIndex;
FCurItem.SetX(i, value);
end;
(*
if FRanges[rngX] <> nil then if FRanges[rngX] <> nil then
begin begin
for i := 0 to XCount-1 do for i := 0 to XCount-1 do
begin begin
GetXYItem(rngX, i, AIndex, value, tmpLabel); GetXYItem(rngX, i, AIndex, value, dummyString);
FCurItem.SetX(value); FCurItem.SetX(i, value);
end; end;
end else end else
begin begin
@ -386,7 +400,7 @@ begin
else else
FCurItem.X := AIndex; FCurItem.X := AIndex;
end; end;
*)
for i := 0 to YCount-1 do for i := 0 to YCount-1 do
begin begin
GetXYItem(rngY, i, AIndex, value, dummyString); GetXYItem(rngY, i, AIndex, value, dummyString);
@ -399,12 +413,13 @@ begin
if FCurItem.Text = '' then FCurItem.Text := tmpLabel; if FCurItem.Text = '' then FCurItem.Text := tmpLabel;
end; end;
FCurItem.Color := clTAColor; // = clDefault
if FRanges[rngColor] <> nil then if FRanges[rngColor] <> nil then
begin begin
GetXYItem(rngColor, 0, AIndex, dummyNumber, dummyString); GetXYItem(rngColor, 0, AIndex, dummyNumber, dummyString);
FCurItem.Color := round(dummyNumber); if not IsNaN(dummyNumber) then
end else FCurItem.Color := round(dummyNumber);
FCurItem.Color := clDefault; end;
Result := @FCurItem; Result := @FCurItem;
end; end;
@ -467,12 +482,12 @@ var
begin begin
ANumber := NaN; ANumber := NaN;
AText := ''; AText := '';
{
if FRanges[ARangeIndex, AListIndex] = nil then if FRanges[ARangeIndex, AListIndex] = nil then
exit; exit;
if FWorksheets[ARangeIndex] = nil then if FWorksheets[ARangeIndex] = nil then
exit; exit;
}
cell := nil; cell := nil;
idx := 0; idx := 0;
@ -651,8 +666,8 @@ begin
begin begin
FPointsNumber := 0; FPointsNumber := 0;
Reset; Reset;
exit;
end; end;
exit;
end; end;
// Split range string into parts for the individual xindex and yindex parts. // Split range string into parts for the individual xindex and yindex parts.