ASE Home Page Products Download Purchase Support About ASE
ChartDirector General
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Zooming / Scrolling charts bug?
Posted by Unknown on Jul-15-2009 22:58
Hi, I am using the latest version of chartdir on linux via Perl.

I have been experimenting with zooming and scrolling charts.

In the zoomscrolldemo.pl example that comes with chart dir, i think there is a bug.

The start time and end time randomly appear with the year set as '1' when refreshing a zoomscrolldemo.pl web page. sometimes it says .  it seems to happen entirely randomly.

the same thing happens with several other charts i created with static data.


i highly doubt this has anything to do with the problem, but i have renamed the pl extensions for zoomscrolldemo.pl, getchart.pl, and loadresource.pl to *.cgi and in all of those scripts changed the pointers to the files

Does anyone else have this problem?  tested and verified in IE / firefox

  Re: Zooming / Scrolling charts bug?
Posted by Peter Kwan on Jul-16-2009 00:32
Hi,

Is your web site accessible for the Internet? If it is accessible from the Internet, is it possible to inform me of the URL, so I can try it myself? I will use a protocol analyzer to monitor the HTTP connection so I can monitor the AJAX communications between the server and the browser. If you cannot post the URL in the forum, you may send the URL to me at pkwan@advsofteng.net.

Regards
Peter Kwan

  Re: Zooming / Scrolling charts bug?
Posted by Avery on Jul-16-2009 00:45
Hi Peter,

My site is not accessible from the Internet unfortunately.

Any tips on what I can do from my end to debug the problem?


Thanks,

-Avery

P.S.


Chartdir is awesome.  This is the only problem I have run into so far.



Hi,

Is your web site accessible for the Internet? If it is accessible from the Internet, is it
possible to inform me of the URL, so I can try it myself? I will use a protocol analyzer to
monitor the HTTP connection so I can monitor the AJAX communications between the
server and the browser. If you cannot post the URL in the forum, you may send the URL to
me at pkwan@advsofteng.net.

Regards
Peter Kwan

  Re: Zooming / Scrolling charts bug?
Posted by Peter Kwan on Jul-16-2009 01:54
Hi Avery,

We are only aware of 1 bug that may cause Zooming and Scrolling not to work, but we think it only affects .NET and has already been fixed in ChartDirector Ver 5.

The bug is due to incompatible locale between Javascript and the .NET framework. Javascript always parse numbers using the Javascript syntax (eg. 1.23456). The .NET framework parses number based on the locale (that is, the decimal point can be a comma or a dot, depending on locale). So non-integers sent from the browser may not be parsed correctly on the server and vice versa. This has been fixed on ChartDirector for .NET Ver 5.

As far as we are aware, our C++ code parse numbers based on the "C locale", which is the same as the Javascript syntax for numbers. So the above should not affect ChartDirector editions that are wrappers to ChartDirector for C++, including ChartDirector for Perl. We tested ourselves and could not find any issues. Also, this issue is never reported to us except on .NET.

Anyway, it is not completely impossible that locale problems is the cause, as the C runtime on different machines may behave differently. If your server is using a locale that is not using a dot as the decimal point, is it possible to test the code with another server that is using the US locale (in case you have such a server)? This is just to avoid this uncertainty.

Please try to test the code using the original zoomscrolldemo.pl sample code, with the only change being the file extension changed to ".cgi".

Please confirm if the error occurs only on zoomscrolldemo.pl, or if it occurs on zoomscrolldemo2.pl

Please inform us if the error occurs every time, or just sometime?

You mentioned "the start time and end time randomly appear". Do you mean the start time and end time on the drop down list boxes become random, or that the start time and end time on the chart are random, or both? If the start time and end time are random, are the drop down list boxes and the chart consistent (show the same random values)?

In your message, you mentioned "sometimes it says . ". It seems the sentence is incompletely. May be the true message is lost during copy and paste. Is it possible to inform me what should be following "sometimes it says"?

Regards
Peter Kwan

  Re: Zooming / Scrolling charts bug?
Posted by Avery on Jul-16-2009 04:22
Peter Kwan wrote:

....

---------it is using us locale.

Please try to test the code using the original zoomscrolldemo.pl sample code, with the
only change being the file extension changed to ".cgi".

---------- can't because i am not the person who operates the box

Please confirm if the error occurs only on zoomscrolldemo.pl, or if it occurs on
zoomscrolldemo2.pl

Please inform us if the error occurs every time, or just sometime?


----------- it always happens after refreshing the page in ie 8

the error always occurs in IE8 after refreshing the page once. however it always displays
the dates correctly the first time it shows up.

You mentioned "the start time and end time randomly appear". Do you mean the start
time and end time on the drop down list boxes become random, or that the start time and
end time on the chart are random, or both? If the start time and end time are random,
are the drop down list boxes and the chart consistent (show the same random values)?

-----------------------
in ie8.... the 1,1,1 | 1,1,1 shows up on the drop boxes.... on the chart itself it says the
current date and the year as july 15 0000   - july 15   0000 (365 days)


In your message, you mentioned "sometimes it says . ". It seems the sentence is
incompletely. May be the true message is lost during copy and paste. Is it possible to
inform me what should be following "sometimes it says"?

--- was just going to paste the 1,1,1 example , sorry about that



in firefox the same problem occurs..


could the problem have to do with using ssl or a proxy?

  Re: Zooming / Scrolling charts bug?
Posted by unknown on Jul-16-2009 05:01
hi peter, i found this example code on the internet of chartdir and it works for me when i view their site:

http://www.hotmonitor.org/cgi-bin/chartdirector41/perldemo_cgi/zoomscrolldemo.pl

this leads me to believe that maybe it is an issue with the cgi extensions for getchart.cgi, loadresource.cgi, and zoomscrolldemo.cgi


(i am assuming whoever made hotmonitor.org is using the same code as original chartdir package

unfortunately i can't change the file extensions on my box

  Re: Zooming / Scrolling charts bug?
Posted by Peter Kwan on Jul-17-2009 00:34
HI Avery,

I cannot see how changing the file extensions can break the code. I suspect the followings:

(a) Issues with the "proxy": The first time the chart is loaded, it is a standard HTTP request, and everything works.

If the chart is "updated" through AJAX (by pressing the "Update" button, or you dragging the chart, etc), the request is an AJAX HTTP request. For some reasons, the proxy are not handling it correctly.

However, if this is really the cause of the problem, I cannot explain why you access hotmonitor, unless your system is not using the proxy when accessing hotmonitor.

(b) There may be other changes, in addition to changes in file extensions. The other changes break the code.

(c) There may be subtle differences between your server and that of hotmonitor that triggers the problem. I am not aware of any difference that can cause this problem (except the locale problem, which should not occur with Perl and should not occur in US locale), but this cannot be rule out. This is possible because in your case, the clients are exactly the same (IE8 and FireFox on the same computer). If the scripts are also the same, then the only difference would be the server, or the network path (the proxy?).


Can you download the "zoomscrolldemo.cgi" source code that you are using on your server? If you can, please send a copy to me, so I can verify if there are any differences from "zoomscrolldemo.pl" that can cause the problem. I can also test it in my own server to see if I can reproduce the problem.

Regards
Peter Kwan

  Re: Zooming / Scrolling charts bug?
Posted by Avery on Jul-17-2009 02:21
Peter Kwan wrote:

HI Avery,

I cannot see how changing the file extensions can break the code. I suspect the
followings:

(a) Issues with the "proxy": The first time the chart is loaded, it is a standard HTTP
request, and everything works.

If the chart is "updated" through AJAX (by pressing the "Update" button, or you dragging
the chart, etc), the request is an AJAX HTTP request. For some reasons, the proxy are
not handling it correctly.

However, if this is really the cause of the problem, I cannot explain why you access
hotmonitor, unless your system is not using the proxy when accessing hotmonitor.

(b) There may be other changes, in addition to changes in file extensions. The other
changes break the code.

(c) There may be subtle differences between your server and that of hotmonitor that
triggers the problem. I am not aware of any difference that can cause this problem
(except the locale problem, which should not occur with Perl and should not occur in US
locale), but this cannot be rule out. This is possible because in your case, the clients are
exactly the same (IE8 and FireFox on the same computer). If the scripts are also the
same, then the only difference would be the server, or the network path (the proxy?).


Can you download the "zoomscrolldemo.cgi" source code that you are using on your
server? If you can, please send a copy to me, so I can verify if there are any differences
from "zoomscrolldemo.pl" that can cause the problem. I can also test it in my own server
to see if I can reproduce the problem.

Regards
Peter Kwan


Hi Peter,

Thanks for your continued support.

I am positive only a few changes have been made to zoomscrolldemo.cgi

my $loadResource = "loadresource.cgi?file=";


    $viewer->setImageUrl("getchart.cgi?img=/tmp/tmpcharts/".$chartQuery);
    $viewer->setImageMap("getchart.cgi?img=/tmp/tmpcharts/".$viewer-
>makeDelayedMapAsTmpFile(
        "/tmp/tmpcharts", $imageMap, 1));

The getchart.pl and loadresource.pl were changed to .cgi

All files for this demo are in one directory together (.pl can't be executed, only cgi from
the web).

the *.js file is in this dir as well

  Re: Zooming / Scrolling charts bug?
Posted by Peter Kwan on Jul-18-2009 01:14
Hi Avery,

My guess is that the error is related to something specific to your server, because other servers seem to work using the same client, and I think the changes to the code should not cause this problem.

Anyway, if you can provide me the exact code you use, I can test it. In most servers using CGI, the extension is not important. The server knows how to handle that by examining the first line "#!/usr/bin/perl". So my server should work with your code and extension.

My speculation is that your server does not like the AJAX request or AJAX response for some reasons. This may be because the data in the AJAX request/response are non-ASCII (they contain binary contents).

In the past, I encounted a case in which a server contained a HTTP filter that automatically modified the HTTP stream to make it UTF8 compliant (that is, change the text encoding to UTF8). The HTTP filter modified the AJAX response and corrupted the response.

Another case was that the server had a "URL rewriter" that modifies all URLs. The modification corrupted the AJAX URL parameters.

A third case was that the server had a HTTP filter that modifies all <IMG> tags by inserting "alt" attributes to the <IMG> tags if they were not already there. This somehow corrupts the HTML and caused the AJAX code not to work.

Some of the above issues can be observed if we can monitor the HTTP protocol. (That's why earlier I asked if the server was accessible from the Internet.) Note that many of the above issues can also be caused by a proxy.

If I can have access to the server, I will probably insert code in "zoomscrolldemo.pl" to log the various variables into a file, so by reading the file, I can see what the server thinks. For example, I may log the $viewer->getCustomAttr("StartYear"), so I can see the StartYear as seen by the server. I will also examine the HTTP protocol to verify that the browser is sending the StartYear correctly to the server. By using this method, I would not be difficult to trace down why the StartYear and other variables are incorrect.

Regards
Peter Kwan