PDA

View Full Version : [CLOSED]chart tipRenderer broken for IE & Chrome (works for firefox)



SantaBarbarian
26 May 2010, 4:00 PM
Having any tipRenderer breaks IE & Chrome (haven't check firefox). For example:



tipRenderer : function(chart, record, index, series){
return 'abc';
}


gives a blank tip but both IE and Chrome's debuggers both give pretty unhelpful errors.

Chrome:
"Uncaught SyntaxError: Unexpected token in"

Chrome provides no other info.

IE:
"Expected identifier, string or number"

IE then points the blame at line 1 of the .jsp file (and a variety of character #s). Ironically, IE's view of the page source says that the first 7 lines of the .jsp file are blank.

If I don't define a tipRenderer at all, Chrome and IE seem to be happy.

Is this a extjs bug or is there a way around this?

evant
26 May 2010, 5:53 PM
Please follow the guidelines when posting a bug: http://www.extjs.com/forum/showthread.php?71015-Posting-to-the-Bug-Forum

SantaBarbarian
26 May 2010, 6:13 PM
Thanks for the pointer. Here is the info:

Ext 3.2.1

Adapter:
ext

css
only default ext-all.css

browser:
IE7,8 & Chrome 5.0.

OS: Win Vista Home Premium

Steps to produce the problem:
Create a tipRenderer for a line chart and have it return anything simple such as 'abc'. View it in any the above browsers and the tip will be ' '. Comment out the tip renderer and the tip will reappear.

evant
26 May 2010, 6:26 PM
Works fine in Chrome and IE for me. http://img268.imageshack.us/img268/9831/chartchrome.png

SantaBarbarian
26 May 2010, 7:06 PM
Thanks for the attention and effort!

Here is what it looks like for me (sorry couldn't figure out the upload util):

http://cdms.physics.ucsb.edu/temp/chrome.jpg

Here is the exact code that produced the above plot:

tipRenderer : function(chart, record, index, series){
var ddd = eval('series.data[index].' + series.yField);
if (series.yField == 'val_1')
ddd = ddd.toFixed(2);
return pos + ' ' + fname + ' ' + lname + ' Day ' + record.data.day + ' ' + defaultLabel + ': \
' + ddd;
},

I've found simplifying it to the following also fails:


tipRenderer : function(chart, record, index, series){
return 'abc';
},

What else would help debug this?

evant
26 May 2010, 7:10 PM
Not sure. Make sure you're pointing to the latest swf file, the one in the download.

SantaBarbarian
27 May 2010, 6:13 AM
Not sure. Make sure you're pointing to the latest swf file, the one in the download.

I've done so. That didn't help.

I did find that the charts sample on the extjs website does work on Chrome. Guess that means it is not a bug, but leaves me little closer to a solution.

evant
27 May 2010, 6:27 AM
Try and break down the code, removing bits until it works.