Bug in Y axis grid labels

Get help and support using chartsEngine for LiveCode.

Moderators: heatherlaine, BvG

Post Reply
MJLew
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4
Joined: Mon Apr 10, 2006 1:10 am
Contact:

Bug in Y axis grid labels

Post by MJLew » Tue Mar 10, 2009 5:54 am

The uppermost Y axis grid label often displays a very large number when it takes a non-integer value. It may be the last few decimal places of a 'non-round' number, but I can't tell for sure.

You can see the problem by changing a single line in the script of the "working with the grid" card of the example stack to this:

put i&TAb& 0.0899975*sin(i*pi/180) & TAB& 0.0899975*cos(i*pi/180)&cr after tData

When I do that the uppermost Y grid value displays as 997.

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Post by malte » Tue Mar 10, 2009 8:22 am

Dear MJLew,

this usually happens if the data is corrupt. This can be either an empty item for the x-axis, or setting the wrong charts["chartItemdel"]. Could you post the exact changes you made to the script? I could only reproduce it, when commenting out the complete repeat loop to set up the data, leaving an empty i. So if you could post the complete script where it breaks for you, I will be able to take an in depth look.

All the best,

Malte

MJLew
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4
Joined: Mon Apr 10, 2006 1:10 am
Contact:

No corruption in my data ;-)

Post by MJLew » Tue Mar 10, 2009 11:35 pm

Dear Malte

The only change I made to the script of the demo was the line I included in my post. I made that change to check whether there was something wrong with my code in a different stack.

What sort of things make the data 'corrupt'? The values certainly look normal when put into the message box.

I certainly didn't set the charts["chartitemdel"] in the demo stack, but I did in my own...

Here is the script of a button that gives the errant chart:
on mouseUp pMouseBtnNo
put the cDataColumns[1] of btn "Stripped" into vals[1] --return delimited list of integers
delete line 1 of vals[1] --column title
put the cROInum of btn "Num..." +1 into roi
put the cDataColumns[roi] of btn "Stripped" into y --return delimited list of real numbers
put y into vals[2]
delete line 1 of y --column title
replace return with comma in y
put max(y) into maxy
put min(y) into miny
set the cROInum of btn "Num..." to roi
combine vals by column --values are now tab-separated points, one per line
set the charts["chartitemdel"] of grp "Graph" to tab
set the charts["data"] of grp "Graph" to vals
set the charts["maxY"] of grp "Graph" to maxy
send "chartsRefresh" to grp "Graph"
end mouseUp

Regards,
Michael

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Post by malte » Wed Mar 11, 2009 12:22 am

Hi Michael,

would you mind sending me the stack in question? I would need to see the data before I can say anything about it.

Cheers,

Malte

MJLew
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4
Joined: Mon Apr 10, 2006 1:10 am
Contact:

Stack is on its way

Post by MJLew » Wed Mar 11, 2009 2:57 am

I'm sending the modified demo stack.

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Post by malte » Wed Mar 11, 2009 8:25 am

Thanks Michael, that was very helpful. I can confirm it is (was) a bug. I have sent you an updated library stack to check out, using yesterdays branch I sent to Andy. Please let me know if that one works for you.

MJLew
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4
Joined: Mon Apr 10, 2006 1:10 am
Contact:

Fixed

Post by MJLew » Wed Mar 11, 2009 11:13 pm

Thanks, Malte. The new version works properly.

Keep up the good service, I appreciate it!

Michael

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Post by malte » Thu Mar 12, 2009 7:01 am

Glad to it works!

Cheers,

Malte

Post Reply

Return to “chartsEngine”