Error in layout.evaluate()

2 views
Skip to first unread message

alfons...@gmail.com

unread,
Jan 4, 2008, 4:48:24 AM1/4/08
to plotkit
Hi.
I am trying to test the example written in the quick start guide but
an error rises telling me this things:

arg has no properties
itemgetter(undefined)Base.js (line 234)
map(function(), [[0, 0], [1, 1], [2, 1.414], 4 more...])Base.js (line
355)
map(function(), [[0, 0], [1, 1], [2, 1.414], 4 more...])Base.js (line
254)
_evaluateLimits()Layout.js (line 295)
evaluate()Layout.js (line 166)
drawGraph()estadisticas.js (line 175)
fn(Object browserEvent=Event mouseout button=0 shiftKey=false, a#est
index.jsp)accordion.js (line 703)
EventManager(Object browserEvent=Event mouseout button=0
shiftKey=false)ext-all.js (line 17)
Event(click clientX=0, clientY=0)yui-utilities.js (line 13)
[Break on this error] return arg[func];

The error is located in layout.evaluate(), I think, due to if I delete
this line the code doesn't generate any error.

Could someone help me? I need to use js charting and plotkit seems to
me a good option.

Thanks in advance.

nun

unread,
Jan 10, 2008, 7:57:30 AM1/10/08
to plotkit
Hi

I was having same issues - after trying several approaches, much
searching, grEvenX's fix (repeated below) from

http://extjs.com/forum/archive/index.php/t-5742.html

fixed it for me (Mochikit 1.4, plotkit-0.9.1)

- replace PlotKit.Base.items function:

// OLD CODE
PlotKit.Base.items = function(lst) {
if (PlotKit.Base.usingPrototype()) {
var rval = [];
for (var x in lst) {
if (typeof(lst[x]) == 'function') continue;
rval.push([x, lst[x]]);
}
return rval;
}
else {
return MochiKit.Base.items(lst);
}
};

section around line 260 in PlotKit/Base.js with:

// NEW CODE
PlotKit.Base.items = function(lst) {
var rval = [];
for (var x in lst) {
if (typeof(lst[x]) == 'function') continue;
if (lst[x] == '______array') continue;
rval.push([x, lst[x]]);
}
return rval;
}
Reply all
Reply to author
Forward
0 new messages