I try to get the chart width & height from a chart I load from a template. This is my code:
Code: Select all
_t2 := TChart.Create(Self);
_t2.Parent := NIL;
Chart_Container.ChartMemStream.Position := 0; // Stream auf Anfang positionieren
LoadChartFromStream(TCustomChart(_t2), TStream(Chart_Container.ChartMemStream));
ChartStreamWidth := _t2.ChartRect.Bottom - _t2.ChartRect.Top;
ChartStreamHeight := _t2.ChartRect.right - _t2.chartrect.left;
if _t2 <> NIL then _t2.Free;
If I use _t2.Parent := TestTab (TestTab is a Pagecontrol Panel) it works as I aspected.
But if I set the paranet <> NIL the chart will be painted completely?!
Is there a way to get the values with parent = NIL ?