Threaded View
-
8 Dec 2011 7:57 AM #1
Setting a chart time axis to have a grid can cause errors with certain step/start val
Setting a chart time axis to have a grid can cause errors with certain step/start val
REQUIRED INFORMATION
Ext version tested:- Ext 4.0.7
- Ext 4.1-pr1
- Setting a chart time axis to have a grid can cause errors with certain step/start values.
- 4.0.7: src/draw/Draw.js Line 1080:
Input:Code:case Ext.Date.DAY:
testFrom = new Date(fromStat[0], fromStat[1],Math.floor(fromStat[2] - 1 / step[1]) * step[1] + 1, 0, 0, 0, 0);break;
Problematic part:Code:var fromStat = [2011, 10, 23, 0, 0, 0, 0]; // Wed Nov 23 2011 01:00:00 GMT+0100 (CET) var step = [Ext.Date.DAY, 10]; // put grid marker/line every 10 days
Possible fix:Code:Math.floor(fromStat[2] - 1 / step[1]) * step[1]+1; // 23 - 1 / 10 = 22.9 -> floor = 22 -> 22 * 10 + 1 = 221
But i'm not sure what exactly this is supposed to accomplish. I just know that a value like 221 does NOT work.Code:Math.floor((fromStat[2] - 1) / step[1]) * step[1]+1; // (23 - 1) / 10 = 2.2 -> floor = 2 -> 2 * 10 +1 = 21
Btw: Steps in the same function is used multiple times for division. If steps === 0, you get 123/0 === Infinity, causing other systems that don't handle this case to fail. Ultimately ending in error messages like "undefined has no method 'substring'".Last edited by mAritz; 14 Dec 2011 at 1:29 AM. Reason: Comments in code examples/fix were wrong
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJSIV-4757
in
4.2.0 Sprint 3.


Reply With Quote