Bug in Y axis grid labels
Moderators: heatherlaine, BvG
Bug in Y axis grid labels
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.
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.
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
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
No corruption in my data ;-)
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
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
Stack is on its way
I'm sending the modified demo stack.
Fixed
Thanks, Malte. The new version works properly.
Keep up the good service, I appreciate it!
Michael
Keep up the good service, I appreciate it!
Michael