I would like to show the same graph (TChart) on 2 different forms. on the first there is a small version, but i would like the user to be able to click a button to show a bigger version of the graph.
Asked
Active
Viewed 332 times
1
-
1Where's the problem, what doesn't work? – Sertac Akyuz Feb 24 '11 at 01:12
-
Do you need both graphs to be visible at the same time? – David Heffernan Feb 24 '11 at 09:17
-
Yes both graphs should still be visible. The ways i have tried haven't worked, including setting the series equal to each other - 'read only' error doing that. – andrewgalpin Feb 25 '11 at 17:09
1 Answers
1
You could have two different controls in which you supply the same set of data. or you can try setting the parent of the control on the new form.
TSmallForm = class
...
procedure TSmallForm.Button1Click(sender : TObject)
var
F : TForm;
begin
F := TForm.Create;
try
ChartComponent.Parent := F;
ChartComponent.Align := alClient;
F.ShowModal;
finally
F.Free;
end;
end;

Ken White
- 123,280
- 14
- 225
- 444

Robert Love
- 12,447
- 2
- 48
- 80
-
Maybe resetting the parent of the chart after the show modal (within the finally) would be a good idea. – Ralph M. Rickenbach Feb 24 '11 at 08:04
-
@Ralph Well, not within the finally for the `Free`. It would need a new try/finally block. – David Heffernan Feb 24 '11 at 09:18
-
I did not write complete code just wanted to show how to move a control. – Robert Love Feb 24 '11 at 19:37
-