Question

How do I print a TChart?

I displayed a TChart, and there is a TButton in the screen.

When the TButton clicked, Windows Printer Dialog will be shown and the TChart will be printed to the selected printer.

How can I do that using Delphi 7?

Thanks.

Was it helpful?

Solution

This is very easy:

procedure TForm1.Button1Click(Sender: TObject);
begin
  with TPrintDialog.Create(nil) do
    try
      if Execute then
        Chart1.Print;
    finally
      Free;
    end;
end;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top