Left/Right margins change

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
TestAlways
Advanced
Posts: 228
Joined: Tue Aug 28, 2007 12:00 am
Location: Oregon, USA

Left/Right margins change

Post by TestAlways » Thu Sep 29, 2011 6:20 pm

TChart 8.08.80307 Win 32

When I preview my chart on the screen, it appears fine.

Image

When I generate a graphic for a report (from the same TChart object), the width for the left/right margins are too big:

Image

When the chart is crated, I checked that the BottomAxis.AutomaticMaximum/AutomaticMinimum are true:

Code: Select all

    assert(chtCostToWait.BottomAxis.AutomaticMaximum);
    assert(chtCostToWait.BottomAxis.AutomaticMinimum);
The DFM at design time for the chart is:

Code: Select all

object chtCTW: TChart
  Left = 0
  Top = 23
  Width = 643
  Height = 374
  AllowPanning = pmNone
  BottomWall.Color = clBlack
  Legend.Alignment = laBottom
  Legend.LegendStyle = lsSeries
  Legend.Visible = False
  Title.Text.Strings = (
    'TChart')
  Title.Visible = False
  BottomAxis.Axis.Width = 1
  BottomAxis.Grid.Visible = False
  BottomAxis.MaximumOffset = 56
  BottomAxis.MinimumOffset = 56
  BottomAxis.MinorTicks.Visible = False
  BottomAxis.TicksInner.Visible = False
  BottomAxis.Title.Caption = 'Years to Wait'
  LeftAxis.Automatic = False
  LeftAxis.AutomaticMinimum = False
  LeftAxis.Axis.Width = 1
  LeftAxis.Grid.Color = clSilver
  LeftAxis.Grid.Style = psDashDot
  LeftAxis.MinorTicks.Visible = False
  LeftAxis.TicksInner.Visible = False
  LeftAxis.Title.Caption = 'Average Retirement Withdrawal'
  RightAxis.Axis.Width = 1
  View3D = False
  View3DWalls = False
  Zoom.Allow = False
  Align = alClient
  BevelOuter = bvNone
  Color = clWhite
  TabOrder = 1
  ColorPaletteIndex = 13
  object srsCostToWait: TBarSeries
    BarPen.Color = clWhite
    BarPen.Width = 2
    Marks.Arrow.Visible = True
    Marks.Callout.Brush.Color = clBlack
    Marks.Callout.Arrow.Visible = True
    Marks.Callout.Length = 8
    Marks.Visible = False
    SeriesColor = 9387812
    Title = 'Cost To Wait'
    Gradient.Direction = gdTopBottom
    XValues.Name = 'X'
    XValues.Order = loAscending
    YValues.Name = 'Bar'
    YValues.Order = loNone
  end
end
Any suggestions on what I could look at?

Thank you,

Ed Dressel

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Left/Right margins change

Post by Sandra » Fri Sep 30, 2011 8:53 am

Hello TestAlways,

Can you tell us, if you export an image to set in report or use TChart component in report, so we can check the problem exactly here?

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

TestAlways
Advanced
Posts: 228
Joined: Tue Aug 28, 2007 12:00 am
Location: Oregon, USA

Re: Left/Right margins change

Post by TestAlways » Fri Sep 30, 2011 1:11 pm

I create the image from the same TChart object that is in my project.

I've attached a demo that recreates the problem--it creates a BMP for a TImage object.

Ed Dressel
Attachments
Create Image Margin Problem.zip
(2.37 KiB) Downloaded 566 times

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Left/Right margins change

Post by Narcís » Mon Oct 03, 2011 8:45 am

Hi Ed,

Thanks for the example project. I could narrow the issue down to this code:

Code: Select all

constructor TForm1.Create(aOwner: TComponent);
var bmp: TBitmap;
begin
  inherited;
  srsCostToWait.FillSampleValues(7);

  bmp:=chtCTW.TeeCreateBitmap(clWhite, Rect(1, 1, Image1.Width, Image1.Height));
  Image1.Picture.Assign(bmp);
end;
And I'm afraid it's a bug (TV52015768) which I have added to the defect list to be investigated. The only workaround I can think of for now is changing BarWidthPercent before exporting the image:

Code: Select all

  srsCostToWait.BarWidthPercent:=35;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

TestAlways
Advanced
Posts: 228
Joined: Tue Aug 28, 2007 12:00 am
Location: Oregon, USA

Re: Left/Right margins change

Post by TestAlways » Fri Dec 02, 2011 4:47 pm

Thank you.

Is there a way to track a bug? Any idea when this might be fixed?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Left/Right margins change

Post by Narcís » Mon Dec 05, 2011 9:24 am

Hi TestAlways,

I'm sorry but I'm not able to provide and estimate date for this at the present moment. You can ask for issue status here and be aware at new release announcements for what's fixed and implemented on them.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply