TChart图型曲线的打印问题!急求!

lanchat 2003-12-22 03:46:15
TChart图型曲线的打印问题!急求!
我使用TChart的print()函数只能打印她的坐标边框,可是去打印不出来其中的绘图曲线?怎样能打印出来呢?
...全文
86 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
47522341 2004-01-13
  • 打赏
  • 举报
回复
将曲线拷贝到后台的报表窗体中的qrchart控件中;可能比较简单些;
konhon 2003-12-22
  • 打赏
  • 举报
回复
上面是DELPHI7的Demo代码.
konhon 2003-12-22
  • 打赏
  • 举报
回复
procedure TBasicForm.BitBtn1Click(Sender: TObject);
Var tmpH,tmpW,tmpWMargin,tmpHMargin:Longint; { margins }
OldOrientation:TPrinterOrientation;
begin
Screen.Cursor := crHourGlass;
OldOrientation:=Printer.Orientation; { <-- save paper orientation }
Printer.Orientation:=poLandscape; { <-- Force Horizontal paper }
try
Printer.BeginDoc; { <-- start printer job }
try
Printer.Title:='TeeChart Printing Demo';

Case RadioGroup1.ItemIndex of
0: Begin { screen proportional }
Chart1.PrintResolution:= 0;
Chart2.PrintResolution:= 0;
Chart3.PrintResolution:= 0;
Chart4.PrintResolution:= 0;
End;
1: Begin { thin lines and small fonts }
Chart1.PrintResolution:= -100;
Chart2.PrintResolution:= -100;
Chart3.PrintResolution:= -100;
Chart4.PrintResolution:= -100;
End;
end;

{ Print the four charts, each one at a different paper position }

{ CALCULATE HORIZONTAL MARGIN }
tmpW:=Printer.PageWidth;
tmpWMargin:=Round(5.0*tmpW/100.0); { <-- 5% margins }
tmpW:=tmpW-2*tmpWMargin; { <-- left and right margins }
tmpW:=tmpW div 2; { half height for left and right charts }

{ CALCULATE VERTICAL MARGIN }
tmpH:=Printer.PageHeight;
tmpHMargin:=Round(5.0*tmpH/100.0); { <-- 5% margins }
tmpH:=tmpH-2*tmpHMargin; { <-- bottom and top margins }
tmpH:=tmpH div 2; { half height for top and bottom charts }

{ left / top chart }
Chart1.PrintPartial( Rect( tmpWMargin,tmpHMargin,
tmpWMargin+tmpW,tmpHMargin+tmpH ) );

{ right / top chart }
Chart3.PrintPartial( Rect( tmpWMargin+tmpW,tmpHMargin,
tmpWMargin+2*tmpW,tmpHMargin+tmpH ) );

{ left / bottom chart }
Chart2.PrintPartial( Rect( tmpWMargin,tmpHMargin+tmpH,
tmpWMargin+tmpW,tmpHMargin+2*tmpH ) );

{ right / bottom chart }
Chart4.PrintPartial( Rect( tmpWMargin+tmpW,tmpHMargin+tmpH,
tmpWMargin+2*tmpW,tmpHMargin+2*tmpH ) );

Printer.EndDoc; { <-- end job and print !! }
except
on Exception do { just in case an error happens... }
Begin
Printer.Abort;
Printer.EndDoc;
Raise;
end;
end;
finally
Printer.Orientation:=OldOrientation; { <-- restore paper orientation }
Screen.Cursor:=crDefault; { <-- restore cursor }
end;
end;

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧