Hi Pete
This is an VCL limitation (the canvas class only works fine when the control has a parent, and this parent ultimately has a form parent).
To overcome this, the only (easy) workaround is to modify TeeChart source code. I've already applied the fix for next coming version 7.01 (free upgrade).
So, open and edit the TeeSVGCanvas.pas unit, replacing the method below.
The important (newly added) lines are these:
Code: Select all
if not Assigned(Panel.Parent) then
Panel.BufferedDisplay:=True; // 7.01
You can use the "TeeRecompile.exe" executable to automatically recompile all the packages and to install them at Delphi 6.
TeeRecompile.exe is included with TeeChart Pro v7 source code installer.
Basically, the fix is to re-enable double-buffering on TChart Canvas when there is no Chart Parent.
When double-buffering is on, the canvas used is an internal TBitmap.Canvas instead of the limited TChart.Canvas. TBitmap canvases do not seem to suffer from this limitation.
regards
david
Code: Select all
function TSVGExportFormat.SVG: TStringList;
var tmp : TCanvas3D;
begin { return a panel or chart in SVG format into a StringList }
CheckSize;
result:=TStringList.Create;
Panel.AutoRepaint:=False;
try
tmp:=Panel.Canvas;
{$IFNDEF CLR} // Protected across assemblies
TTeePanelAccess(Panel).InternalCanvas:=nil;
{$ENDIF}
CheckProperties; // 7.01
Panel.Canvas:=TSVGCanvas.Create(result);
try
Panel.Canvas.Assign(tmp);
if not Assigned(Panel.Parent) then
Panel.BufferedDisplay:=True; // 7.01
TSVGCanvas(Panel.Canvas).Antialias:=FProperties.CBAntiAlias.Checked;
Panel.Draw(Panel.Canvas.ReferenceCanvas,TeeRect(0,0,Width,Height));
finally
Panel.Canvas:=tmp;
end;
finally
Panel.AutoRepaint:=True;
end;
end;