The graph is drawn outside the axes

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
NatSam
Newbie
Newbie
Posts: 17
Joined: Wed Nov 14, 2007 12:00 am

The graph is drawn outside the axes

Post by NatSam » Sat Nov 12, 2011 2:21 pm

When I create a bar graph and maximize the form, some bars are drawn outside the axes.

See sample project and printscreens attached:

Normal.gif => Printscreen of form (Windowstate = wsNormal) - Zip in screens.zip
resized.gif => Printscreen of form (Windowstate = wsMaximized) - Zip in screens.zip
Project27.ZIP => Sample project (compiled & packed)
Teechart.zip => Source file (Zip)

I´m using:
TeeChart Pro V. 8.08.80307
Delphi 2007 (11.0.2902.10471)
Attachments
Screens.zip
Screens
(125.55 KiB) Downloaded 376 times
Teechart.zip
Sources
(131.97 KiB) Downloaded 375 times
Project27.zip
Project
(471.12 KiB) Downloaded 375 times

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: The graph is drawn outside the axes

Post by Yeray » Mon Nov 14, 2011 4:23 pm

Hello,

I've seen you set the bottom axis MinimumOffset and MaximumOffset, both to 28 pixels. Note that this is a fix distance, but the bars width varies when the chart is resized. In your case, the MinimumOffset is the distance from the Left axis to the bottom axis 0 value. Then, when the chart is resized and the first bar size is bigger than 28, it looks cut.
I'd suggest you to put a 0 MinimumOffset and MaximumOffset (and let TeeChart calculate it internally for you) or to calculate it at onResize event. For example, like this:

Code: Select all

  with Chart1.Axes.Bottom do
  begin
    MinimumOffset:= (Chart1[0] as TBarSeries).BarWidth+10;
    MaximumOffset:=MinimumOffset;
  end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

NatSam
Newbie
Newbie
Posts: 17
Joined: Wed Nov 14, 2007 12:00 am

Re: The graph is drawn outside the axes

Post by NatSam » Mon Nov 14, 2011 5:03 pm

I changed the MinimunOffset to 0 but the Teechart change it to 22 (and problem persists when I resize form).

Then I use the code you sendid, but it only works when I resize the form (not when form is Maximized).

See attached pictures:

Normal_Screen.GIF -> Display form
Resized_Form.GIF -> After form is resized
Maximized_Screen.GIF -> After maximize form
Restores_Screen.GIF -> After restore form (exit maximized)

In each instant the graph looks different.
Attachments
Teechart.zip
(127.14 KiB) Downloaded 355 times

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: The graph is drawn outside the axes

Post by Yeray » Wed Nov 16, 2011 11:16 am

Hello,
NatSam wrote:I changed the MinimunOffset to 0 but the Teechart change it to 22 (and problem persists when I resize form).
Right, it still happens in v8, but not in v2011.
See the attached project and the exe compiled with TeeChart v2011.
Teechart_v2011_nooffsets.zip
(403.16 KiB) Downloaded 380 times
NatSam wrote:Then I use the code you sendid, but it only works when I resize the form (not when form is Maximized).
It's a little bit tricky to make it run. You need to calculate the offsets in function of the BarWidth value. And the chart needs to be drawn so BarWidth has a new/correct value. So it would be better if you put that code in OnAfterDraw event, to be sure you are taking the correct BarWidth value. However, at this point the chart has already been drawn and the new calculated Offsets won't be applied until the next repaint. So you could force a chart repaint into the AfterDraw event, with the endless loop danger it represents. Take a look at the attached project, compiled with TeeChart v8.
Teechart_v8_afterdraw.zip
(349.19 KiB) Downloaded 392 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

NatSam
Newbie
Newbie
Posts: 17
Joined: Wed Nov 14, 2007 12:00 am

Re: The graph is drawn outside the axes

Post by NatSam » Wed Nov 16, 2011 12:06 pm

Today the version 8 is perfect for me (I use Delphi 2007).

I migrate to the 2011 version of it if the cost were not so high. Is possible to get a discount on the upgrade value?

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: The graph is drawn outside the axes

Post by Yeray » Wed Nov 16, 2011 12:32 pm

Hello NatSam,
NatSam wrote:I migrate to the 2011 version of it if the cost were not so high. Is possible to get a discount on the upgrade value?
I'd suggest you to contact the sales department for it, emailing at "sales at steema dot com".
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

NatSam
Newbie
Newbie
Posts: 17
Joined: Wed Nov 14, 2007 12:00 am

Re: The graph is drawn outside the axes

Post by NatSam » Wed Nov 16, 2011 2:31 pm

Today I use:

Delphi 2007 (11.0.9.2902.10471)
QuickReport 5.02
ReportBuilder Enterprise 12.05

The 2011 version is 100% compatible with this components ?

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: The graph is drawn outside the axes

Post by Yeray » Wed Nov 16, 2011 4:14 pm

Hello NatSam,
NatSam wrote:Delphi 2007 (11.0.9.2902.10471)
Yes, TeeChart supports D2007.
NatSam wrote:QuickReport 5.02
You'll find the packages to recompile and install in the folder "\Delphi11\QuickReport" in your TeeChart installation path.
Here it is the QuickReport article with the instructions to build and compile that packages:
http://www.teechart.net/reference/articles/index.php
If you find any problem in the process, don't hesitate to let us know.
NatSam wrote:ReportBuilder Enterprise 12.05
You'll have to contact Digital Metaphors to get instructions about how to recompile and install the packages to integrate TeeChart into ReportBuilder.

Anyway, I'd suggest you to try the evaluation version before purchasing it so you can check if it fits your requirements.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply