josejaner / flot

Automatically exported from code.google.com/p/flot
MIT License
0 stars 1 forks source link

Flot Navigate seems not to work with jQuery 1.7.1 #643

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I am currently using Flot in my Wordpress plugin WP SlimStat

http://wordpress.org/extend/plugins/wp-slimstat/

Recently, Wordpress 3.3 has updated the built-in jQuery library to 1.7.1. I was 
testing my plugin (and your charts) with this new version, and it looks like 
the zoom functionality is not working anymore. Everything was working fine with 
the previous version of jQuery, though.

With version 1.7.1 I get the following error message in Firefox

Error: uncaught exception: [Exception... "An invalid or illegal string was 
specified"  code: "12" nsresult: "0x8053000c (NS_ERROR_DOM_SYNTAX_ERR)"  
location: 
"http://multisite.dev/wp-content/plugins/wp-slimstat/view/flot/jquery.flot.min.j
s?ver=0.7 Line: 1635"]

As you can see I'm using the uncompressed version of flot, to better identify 
where the problem occurs. This happens as soon as I try to zoom in/out. The 
chart disappears and all the ticks are crammed together in the bottom left hand 
corner of the canvas (see attachment).

This is the code I use to initialize the chart

jQuery.plot(jQuery("#chart-placeholder"),[a,b,c],{zoom:{interactive:true},pan:{i
nteractive:true},series:{lines:{show:true},points:{show:true},colors:[{opacity:0
.85}]},xaxis:{tickSize:1,tickDecimals:0<?php echo "$datachart->min_max_ticks"; 
echo (!empty($wp_slimstat_view->day_interval) && 
$wp_slimstat_view->day_interval > 20)?',ticks:[]':',ticks:window.ticks' 
?>,zoomRange:[5,window.ticks.length],panRange:[0,window.ticks.length]},yaxis:{ti
ckDecimals:0,tickFormatter:tickFormatter,zoomRange:[5,<?php echo 
$datachart->max_yaxis+intval($datachart->max_yaxis/5) ?>],panRange:[0,<?php 
echo $datachart->max_yaxis+intval($datachart->max_yaxis/5) ?>]}, 
grid:{backgroundColor:"#ffffff",borderWidth:0,hoverable:true,clickable:true},leg
end:{container:"#chart-legend",noColumns:3}});

Your help would be greatly appreciated not just by me, but by the entire 
community of WP SlimStat users 

Original issue reported on code.google.com by duechiac...@gmail.com on 28 Nov 2011 at 2:31

Attachments:

GoogleCodeExporter commented 8 years ago
I just downloaded this demo on my local environment

http://people.iola.dk/olau/flot/examples/navigate.html

and replaced jQuery 1.5.1 with 1.7.1, and I get the same error as above, both 
in Chrome and Firefox. 

Original comment by duechiac...@gmail.com on 28 Nov 2011 at 2:59

Attachments:

GoogleCodeExporter commented 8 years ago
Hm, it seems like there have been some changes in the way jQuery sets up 
events. it's perhaps a problem with the inline drag event thing dependency in 
that plugin. Maybe see if there's been an update to that?

Original comment by ole.laur...@gmail.com on 28 Nov 2011 at 4:00

GoogleCodeExporter commented 8 years ago
Thank you for pointing me into the right direction. That was the problem, 
indeed. 

Original comment by duechiac...@gmail.com on 28 Nov 2011 at 6:03

GoogleCodeExporter commented 8 years ago
I know this is not the 'official' release, but if someone needs it, I'm 
attaching the updated library.

Thank you so much!

Original comment by duechiac...@gmail.com on 28 Nov 2011 at 6:05

Attachments:

GoogleCodeExporter commented 8 years ago
Could you post a non-minified version as well? I've observed an issue (that 
under jQuery 1.7.1 I can only zoom in with the scroll wheel, not out) and I'd 
like to see if it's related to this update before I start filing bugs.

Original comment by simber...@gmail.com on 21 Dec 2011 at 9:44

GoogleCodeExporter commented 8 years ago
Sure, I'm out of town for a couple of weeks, I will post it as soon as I get 
back.

Happy Holidays!

Original comment by duechiac...@gmail.com on 21 Dec 2011 at 9:56

GoogleCodeExporter commented 8 years ago
Sorry for the delay, here you go :)

Original comment by duechiac...@gmail.com on 10 Jan 2012 at 5:03

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you!

Original comment by great.ju...@gmail.com on 9 Feb 2012 at 2:37

GoogleCodeExporter commented 8 years ago
I just hit this one on Safari 5.0.6, where it just leads to the graph vanishing 
silently.

Original comment by donal.k....@man.ac.uk on 14 Feb 2012 at 1:58

GoogleCodeExporter commented 8 years ago
The problem was actually with the inline mousewheel plugin, not the drag 
plugin; you just happened to update both in your version.  I've updated the 
mousewheel inline in the master branch; merging this with issue #685.

Original comment by dnsch...@gmail.com on 4 May 2012 at 7:46