Page 1 of 1

Zoom & DateTime - Bug?

Posted: Wed Feb 06, 2008 2:09 pm
by 10048184
Dear All

I have an odd problem when trying to zoom a chart with Line series where the BottomAxis is in DateTime format.

- Zooming with the mouse (usual topleft-to-bottomright) and also by code results in the date completely wrong, thus the values are obviously not displayed because no data is found for that date.
I get for example 30.12.1899 where my full range is from 1.12.2007 to 5.12.2007.

- When I however first set paging (even the biggest number of poinst possible), then zooming works correctly.

I should mention that my datasource is from text file. But that should not matter considering the second point
Does anyone have an idea how to solve this ?

Regards, Daniele

Posted: Wed Feb 06, 2008 2:42 pm
by narcis
Hi Daniele,

I'm not able to reproduce the problem using TeeChart Pro v8.02 VCL and the code below. Could you please send us a simple example project we can run "as-is" to reproduce the problem here and let us know the TeeChart version you are using?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Code: Select all

uses DateUtils;

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Series1.XValues.DateTime := true;

  for i:=0 to 100 do
    Series1.AddXY(Today + i, random);
end;
Thanks in advance.

Posted: Wed Feb 06, 2008 4:18 pm
by 10048184
thank you,
I uploaded now a test-project for you to reproduce.
I'm using Tchart pro v8.something

I did simplify the project to the bare bones, so the error must be found in the code - or the component. the series are created at run-time. maybe the problem is there. I used sample code I found on your page.

Thanks
Daniele

Posted: Fri Feb 08, 2008 9:28 am
by 10048184
Dear Narcís

I now found out what the problem is, but do not know how to solve it.
The problem only appears if - as in my case - a ChartScrollBar is used!
By removing the scrollbar the Chart can be zoomed correctly.

Do you have any ideas of a workaround - speak using ScrollBar and still zooming correctly?

I'd much appreciate your help

Cheers
Daniele

Posted: Fri Feb 08, 2008 10:24 am
by narcis
Hi Daniele,

Thanks for the information.

We think the problem is in the TChartScrollBar.RecalcPosition implementation. We'll try to improve this for next releases. In the meantime the "solution" would be to use regular TScrollBar and manually change axis scale by using TChartAxis.SetMinMax method (zooming and scrolling is merely changing axis minimum and maximum value). It may be also necessary setting scrollbar's min and max values in the zooming and scrolling events.

I have sent you an e-mail with an example using TScrollBar.

Posted: Fri Feb 08, 2008 10:28 am
by 10048184
Ok, thanks for your suggestion. I'll try like you say

regards
Daniele

need sample too

Posted: Wed May 21, 2008 6:43 am
by 10546837
Hello Narcís

Could you provide me with a ChartScrollBar / DateTime sample too

thx. HeinzJ

Posted: Wed May 21, 2008 11:21 am
by narcis
Hi HeinzJ,

Sure! I've just sent you the example to your forums contact e-mail address.

series disappears

Posted: Thu May 22, 2008 12:57 pm
by 9345189
I have a simliar problem with Teechart 7.12.

I am using DateTime as the horizontal axis. The chart works perfectly until I add a scrollbar to it.

Here the horizontal axis shows correct values, but the series disappears when I zoom or scroll. When I zoom out to 100% size, everything is showing correctly again.

Is there a fix for this?

Could you please send me the sample of your Scrollbar/DateTime.

Posted: Thu May 22, 2008 1:10 pm
by narcis
Hi KymaNorway,

I've just sent you the example. I'm afraid there's no fix for that at the moment.

Not fixed :shock:

Posted: Mon May 26, 2008 10:14 am
by 9345189
is it not fixed in version 8 either? It seems like such an obvious and big bug.

Posted: Mon Jun 02, 2008 10:23 am
by narcis
Hi KymaNorway,

No, this issue (TV52013102) hasn't been fixed yet. I've set it to a high-priority bug to be fixed for future releases.

Re: Zoom & DateTime - Bug?

Posted: Wed Jun 23, 2010 12:37 pm
by 10555436
Hi Narcís,

could you provide me the example? I have a chart with lots of bar and I need to scroll them step by step instead paging.

Thanks in advance,

Miguel Ángel.

Re: Zoom & DateTime - Bug?

Posted: Wed Jun 23, 2010 12:57 pm
by narcis
Hi Miguel Ángel,

Yes, I have sent you the example. Notice that TV52013102 was fixed for v8.04, which was released in October 2008.