Page 1 of 1

Printout wrong when paging enabled

Posted: Tue Jul 28, 2009 4:33 am
by 10553406
When paging is enabled, if I print the chart that paging arrows are printed in the correct place but the "Page x of y" text and surrounding rectangle and shadow are printing to the bottom right of the arrows. It may have something to do with margins being applied twice to work out the printed co-ordinates of the box, because the smaller the margines, the closer the box is printed to the arrows.

Printer is a brand new HP LaserJet P4015x running under Vista.
Using version 8.05 of TeeChart PRO.
Delphi 2007.

Anyone else see this issue?

Re: Printout wrong when paging enabled

Posted: Tue Jul 28, 2009 7:33 am
by yeray
Hi JNorth,

Are you talking about TPageNumTool?

Re: Printout wrong when paging enabled

Posted: Wed Jul 29, 2009 12:19 am
by 10553406
Yes, however I have the Chart | Paging | Points per page option set to 20 in the chart so I dont need to add the PageNumTool explicitly to the Tools list.

EDIT: I am creating a PageNumTool if the number of points exceed the 20 set in the MaxPointsPerPage property. (Picking this code up again after being away for a month).

The only Tools being used is the Anti-Alias one. I've tried disabling the Tool and the printouts are still incorrect. The visibility of the legend also has no effect on the outcome.

I've attached the printed output and uploaded the images. These were created by printing to the Snag-It 9 printer. These files contain the same output that we are seeing from a physical printer.

There are two different captures, each with two pages. One uses the default margin values and the other has the margins all set to 5%. You can see that the Page text is closer to the page edge when the margins are smaller.

cheers,
Jeremy

Re: Printout wrong when paging enabled

Posted: Wed Jul 29, 2009 9:25 am
by yeray
Hi Jeremy,

I've tried to reproduce it exporting a similar chart to yours to a bmp but couldn't. Is the problem reproducible exporting to a bitmap? Could you please modify the following code until we can reproduce the problem here?

Code: Select all

uses series, TeeTools, TeeAntiAlias, TeePageNumTool;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1.Align := alClient;

  for i := 0 to 5 - 1 do
  begin
    Chart1.AddSeries(TLineSeries.Create(self));
    Chart1[i].FillSampleValues(100);
    (Chart1[i] as TLineSeries).Pen.Width := 2;
  end;

  Chart1.Tools.Add(TAntiAliasTool.Create(self));
  Chart1.Tools.Add(TPageNumTool.Create(self));

  Chart1[0].XValues.DateTime := true;

  Chart1.Pages.MaxPointsPerPage := 20;

  Chart1.Gradient.Visible := true;
  Chart1.Gradient.StartColor := RGB(162, 189, 253);
  Chart1.Gradient.EndColor := clWhite;
  Chart1.Aspect.Orthogonal := false;
  Chart1.Walls.Left.Visible := false;
  Chart1.Walls.Bottom.Visible := false;
  Chart1.Chart3DPercent := 30;

  Chart1.Draw;
  Chart1.SaveToBitmapFile('C:\test.bmp');
end;

Re: Printout wrong when paging enabled

Posted: Wed Jul 29, 2009 10:55 pm
by 10553406
I didn't export it, I printed it.

Saving the chart as a bitmap works fine.

I can confirm my suspicions about the issue being with the margins of the printout. If I set all of the margins to 0, then the location of the "Page 1 of X" text is almost perfect. I say almost because it might be a pixel or two off being perfect, but that might be expected.

Re: Printout wrong when paging enabled

Posted: Thu Jul 30, 2009 9:41 am
by yeray
Hi Jeremy,

Yes you are right. Both print preview and exporting to bitmap everything looks fine but when printing, the text box is displaced. So I've added it to the wish list to be fixed in further releases (TV52014333).