|
Clipping - V4.0 to V5.0.4 upgrade |
Posted by Duncan Berriman on Feb-02-2011 20:33 |
|
Hi,
Just upgraded (or rather just testing upgrade from V4 32 bit to V5.0.4 64 bit) and I have noticed that my line graphs are being clipped.
It would appear the Y axis autosizing has changed so that it now clips differently.
Bar charts look fine.
Help!
Thanks in advance
Duncan
|
Re: Clipping - V4.0 to V5.0.4 upgrade |
Posted by Duncan Berriman on Feb-03-2011 00:33 |
|
Just incase it helps I am using....
c->yAxis()->setLinearScale(0, NoValue);
c->yAxis()->setAutoScale(0.1);
and
c->yAxis2()->setLinearScale(0, NoValue);
c->yAxis2()->setAutoScale(0.1);
unless my code (unchanged) is doing something strange. I guess it could be a 64 bit issue. I'll check whilst I wait a response. |
Re: Clipping - V4.0 to V5.0.4 upgrade |
Posted by Duncan Berriman on Feb-03-2011 00:43 |
|
It looks like its some sort of weird 64 bit issue passing a value of 0 from C to a C++ routine as a double.
Any advice still appreciated if you have an insight as to why and what to do.
Duncan |
Re: Clipping - V4.0 to V5.0.4 upgrade |
Posted by Duncan Berriman on Feb-03-2011 01:26 |
|
Interesting it was my max y axis values being passed.
I was calling my C++ routine from C passing 0 as the arg for boths, these are received as doubles in the C++ routine and end up containing 0.028308.
My logic checked for a value of >0 and added clipping.
I tried casting 0 as a double with no difference.
but if I define a double in my C program, set that to 0 and pass it all works well.
I'm guess I'm missing something basic in my understanding here re passing args in c and C++ and doubles.
Any insight appreciated! |
Re: Clipping - V4.0 to V5.0.4 upgrade |
Posted by Peter Kwan on Feb-03-2011 01:43 |
|
Hi Duncan,
In theory, it is not possible at all to call ChartDirector functions in C code. (It cannot even include the "chartdir.h" file.) So I assume you are calling your own functions (written as C++) from C code, and the parameter passing seems incorrect.
I am not too sure exact what happens. If you would like to debug it, you may need to debug it at the assembly level. Although it is uncommon, it is not impossible that the bug is in the compiler.
(Having ported ChartDirector to so many OS using some many 32-bit / 64-bit compilers, we have encountered quite a number of strange problems, which turns out to be compiler bugs, so we may need to consider this as one of the possibilities.)
Regards
Peter Kwan |
Re: Clipping - V4.0 to V5.0.4 upgrade |
Posted by Duncan Berriman on Feb-03-2011 18:59 |
|
Hi Peter,
You are correct we are using C to call our own C++ module (from your own excellent examples many years back) and then calling chartdir.
I think as you mention it is probably a compiler bug. Long time since I played with those when I used to field test such things.
All seems to be working correctly now I have coded round it. It is however slightly worrying for everything else we run.
We'll need to upgrade our licences I'll contact you via email for that.
Thanks for your help.
Duncan |
|