Page 1 of 1

Left/Right margins change

Posted: Thu Sep 29, 2011 6:20 pm
by 10546565
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

Re: Left/Right margins change

Posted: Fri Sep 30, 2011 8:53 am
by 10050769
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,

Re: Left/Right margins change

Posted: Fri Sep 30, 2011 1:11 pm
by 10546565
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

Re: Left/Right margins change

Posted: Mon Oct 03, 2011 8:45 am
by narcis
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;

Re: Left/Right margins change

Posted: Fri Dec 02, 2011 4:47 pm
by 10546565
Thank you.

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

Re: Left/Right margins change

Posted: Mon Dec 05, 2011 9:24 am
by narcis
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.