Page 1 of 1

The graph is drawn outside the axes

Posted: Sat Nov 12, 2011 2:21 pm
by 10547371
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)

Re: The graph is drawn outside the axes

Posted: Mon Nov 14, 2011 4:23 pm
by yeray
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;

Re: The graph is drawn outside the axes

Posted: Mon Nov 14, 2011 5:03 pm
by 10547371
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.

Re: The graph is drawn outside the axes

Posted: Wed Nov 16, 2011 11:16 am
by yeray
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 376 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 387 times

Re: The graph is drawn outside the axes

Posted: Wed Nov 16, 2011 12:06 pm
by 10547371
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?

Re: The graph is drawn outside the axes

Posted: Wed Nov 16, 2011 12:32 pm
by yeray
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".

Re: The graph is drawn outside the axes

Posted: Wed Nov 16, 2011 2:31 pm
by 10547371
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 ?

Re: The graph is drawn outside the axes

Posted: Wed Nov 16, 2011 4:14 pm
by yeray
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.