I have a couple of (Cloned) 3D Charts on a form, about 10 to 20.
The first (main) one has a TTeeCommander component connected to zoom, pan and rotate it.
When this main chart gets zoomed, rotated, moved, all other Charts should follow in the same way.
Currently what I do is using the ChartAfterDraw event of the main chart and do this:
Code: Select all
procedure TMyForm.ChartAfterDraw(Sender: TObject);
var
i: Integer;
begin
for i := 1 to High(FChartArray) do
begin
if (FChartArray[i].Chart.View3DOptions.Zoom <> FChartArray[0].Chart.View3DOptions.Zoom) or
(FChartArray[i].Chart.View3DOptions.Rotation <> FChartArray[0].Chart.View3DOptions.Rotation) or
(FChartArray[i].Chart.View3DOptions.Elevation <> FChartArray[0].Chart.View3DOptions.Elevation) or
(FChartArray[i].Chart.View3DOptions.HorizOffset <> FChartArray[0].Chart.View3DOptions.HorizOffset) or
(FChartArray[i].Chart.View3DOptions.VertOffset <> FChartArray[0].Chart.View3DOptions.VertOffset) then
begin
FChartArray[i].Chart.View3DOptions.Assign(FChartArray[0].Chart.View3DOptions);
FChartArray[i].Chart.Refresh;
end;
end;
end;
This works pretty well most of the times but the program freezes (endless loop) for example when maximizing the form.
Is there any other way just updating the other charts when one of the View3DOptions has changed by hand?
best regards