JQuery :: Load A Flot Chart Inside A Tab - Invalid Dimensions For Plot
Jun 24, 2009
I am trying to load a jquery chart (Flot) inside the second tab of jQuery tabs. It works fine on the opening tab, but if i bury the chart in any tab, it breaks and throws the js error "Invalid dimensions for plot..."I looked around and the problem might be that because the second tab is hidden at page load, it is breaking something... I dug up a possible jquery fix/plugin called frameReady, which allows for you to load iframes, but I am not sure how to apply it.
[URL]
how I can enable the second tab to show the chart?
I am trying to load a jquery chart (Flot) inside the second tab of jQuery tabs. It works fine on the opening tab, but if i bury the chart in any tab, it breaks and throws the js error "Invalid dimensions for plot..."
I looked around and the problem might be that because the second tab is hidden at page load, it is breaking something... I dug up a possible jquery fix/plugin called frameReady, which allows for you to load iframes, but I am not sure how to apply it.
Example:[url]
Source:[url]
How I can enable the second tab to show the chart?
I am trying to populate a flot chart using PHP but things do not seem to be working. If I put in the numbers manually for the chart everything is working fine but if I pass them via ajax from a php script nothing displays.
Here is my php:
And here is my javascript:
The background of the chart appears but no data. I suspect that its because the json_encode returns a string.
I am using Flot its a graphing tool.I insert my flot graphing code into my main page which i do not want to show unless the user clicks a show graph button.The code is inserted into my hidden div like so:
When the user clicks the "show graphs" link it changes the property of "mydiv1" to display='Block'.This is where the problems start. Everything in the <Div> now appears except the chart. If i load the chart on its own it works fine and if i load the chart into a <div> that has its display properties starting off as 'Block' its also fine. The problem only occurs when i change the display property after the page is loaded.
I have also Googled this issue plenty of times, but nothing seems to be working 100% and/or the "solution" found is several years old.I have a text field on a webpage where a user enters in a URL to an image and then clicks a button to preview it. I want to restrict the image's size, so if it is larger than 600x450 then it will be automatically resized to those dimensions.The problem I have with this code is that the myImage.onerror event always fires if the image is large. My question is: how do you make the script "wait" for the image to load completely before trying to retrieve the width and height? Or, even better, how do you prevent the image failing to load?
Also, I know how to get the image's dimensions via PHP; however, according to the getimagesize() function's documentation on php.net, the function downloads the image to the server before retrieving the image's width and height, which could be potential trouble if a malicious or ignorant user enters a URL to an excessively large image.
I need to create a real-time line plot on an html page, without resorting to java, cgi, or anything server-side or offline. I think maybe this could be done with javascript, or dhtml, and most likely macromedia flash - what may be the best choice for a clean and portable design?
I am trying to plot a line using the variables that I have derived in this "rectangular to polar" conversion program. I am just new to javascript and to programming generally. But with the help of sample codes here.
I have read that drawing in javascript isn't so easy. Could you give me some hints on how to draw the following variable in polar coordinates. Do I need to use another programming language aside from javascript ?
So I have a script that retrieves images from Flickr and displays them on my site. I have Fancybox so that when a user clicks on the image, the picture will come up in a... "fancy box"... everything seems correct, but when I click on the image, it sends the user to the location of the picture on Flickr servers instead of opening it using Fancybox.
Here is the code for the Flickr retrieving... <script type="text/javascript"> var FLICKR_ID = '41313008@N08'; var THUMBNAIL_HTML = '<a id="single" href="%IMAGE_URL%" title="%IMAGE_TITLE%"><img alt="%IMAGE_TITLE%" src="%THUMBNAIL_URL%" /></a>'; function displayImages(data){ var htmlString = ""; $.each(data.items, function(i,item){ var thumbnail = (item.media.m).replace("_m.jpg", "_s.jpg"); var large = (item.media.m).replace("_m.jpg", ".jpg"); htmlString += THUMBNAIL_HTML; htmlString = htmlString.replace(/%IMAGE_TITLE%/g, item.title); htmlString = htmlString.replace(/%IMAGE_URL%/g, large); htmlString = htmlString.replace(/%THUMBNAIL_URL%/g, thumbnail); }); $('#gallery').html(htmlString); } $.getJSON("[URL]", displayImages); </script> <a id="single" is the id that goes to open the image in Fancybox. When I disable this Flickr script, and input an image manually, it works 100%.
I tried to do a loading bar during the computation of the data of my google map, unfortunately without success for the moment. I use the load function serveral times but never with a google map / javascript, that's probably the problem linked to it. Here is my 2 html pages : 1- dynamicmap.html 2-googlemap.html.
For information, I worked with Django, the googlemap.html works very well when I used this "outside" the dynamicmap.html ... I tried to add the function "initialize()" as argument to load function. I am very lost about how to do. Any remarks is welcom i am still new in webdevelopment, but experimentend in classic programation.
I'm using .load to load a snippet of code into a div on a page. This works fine, but IE won't show the div if there is any JQuery, or indeed and sign of <script></script> tags. The snippet I'm loading contains a form with a from/to date and needs some form validation, all of which I wish to use JQuery for, for instance:
[Code]...
Putting this script anywhere in the main body of my html page means that JQuery can't see the fields which eventually get loaded into the waiting div on the same page (even when using $(document).ready ). The field seems to be too deep in the DOM and loading too late for JQuery to see it. Anyway, this is why I want to include it at the top of the loaded html snippet. Is IE known to have a problem with scripts in .load-ed snippets? p.s.The reaction of IE is just to show a blank div.
I have an img of a map of Europe in a div. I want to plot routes between cities in Europe as dotted lines. The image is scrollable and I want the routes to scroll with the image. So the routes should be attached to the image. Furthermore, when drawing routes outside of the viewable area, the routes should be clipped so they don't show up outside of the image. but when the image is scrolled, the routes should appear.
i'm new to jQuery and SVG and my homerwork is to develope ECG chart. It should show data with: - 25mm/s - 50 mm/s - 1mm/mV - 5mm/mv I've decided to use Keith Wood jQuery plugin and have some questions. Is it possible to manipulate with gridlines when using graphing extension? I'd like every full second line to be thicker than the rest. Secondly, length on chart in every resolution should be equal to real length. Or should I make that chart step by step using drawing functions?
I cannot get the dimensions of my swf to animate for whatever reason. This works: function resizeSwf(contentHeight){ document.getElementById('swfplayer').height = contentHeight + 20; } But this does not: function resizeSwf(contentHeight){ $("#swfplayer").animate({ height:contentHeight + 20 },400); } I am using jquery-1.4.3.min.js and I have verified it is at the correct path.
So I'm working in a project where I need to get the dimensions of an image. If I use .height() of the image I get 0 returned, but if use .height() on its surrounding div I get the image's height returned.I need the height and width of the actual image, what should I do?
I've been trying to find a topic talking about how to save a jqplot chart as an image (jpg,png,bmp.....) but i couldn't find anything wich was related to jqplot (there was only canvas2image which was close but when i tried it, i figured that it wasn't designed for jqplot...... :s ) ,
I need that function because when i copy/paste the chart from internet explorer 8 the chart is all different (the x,y axis and even the curve isn't at the right place..
I am working on a project that will involve large amounts of data. We have discussed how to summarize for the end user. Final presentation will be something like a bar chart with 15-30 bars. Each bar will be built by blocks whose height and column will be determined by formulas applied to data in the database. A static report is obviously no problem.
I want to develop a sandbox where the end user can drag and drop blocks from one column onto a different column. Others on the team think this can only be done with AJAX while I think jQuery will work and actually be better.
I'm looking for some guidance on the best way to use jQuery to change a set of simple shirt measurements (in a table) from inches to cm, and back again. Can I tell jQuery to look inside a specific table and then convery all the numbers it finds to another unit of measurement?
I have a photo gallery built with XML and PHP (pulling images from a client's Myspace albums).The gallery works fine, displays thumbnails and captions, paginates properly, etc.The whole thing is loaded by AJAX into a div, which complicates things a bit, but it works.When a visitor clicks a thumbnail, the full-sized image displays in a div overlay on top of the gallery div.The overlay is hidden until a thumbnail is clicked, when it is toggled to "visibility:visible". When the overlay "close" link is clicked, the overlay is hidden again.That also works. Some of the images are too large to display properly inside the div without throwing off the layout, so I had to set a max height and width.I can't just use CSS to set the dimensions or it'll size EVERY image to those dims, and the photos are all different sizes...some wider, some longer.So I used javascript to check the image size when the thumbnail is clicked.
All of that worked.(Although strangely, if I try to toggle the visibility as part of the function rather than putting it into the link, it doesn't work!)The problem is that once the dimensions of "img1" are set, they STAY that size even when the next thumbnail is clicked.So if the first image is 800px tall, the script crops it to 640px...then the next image may only be 400px pix tall but it displays as 640px high, making it distorted.I tried to add a "resetImgSize" function to the "close" link in the overlay, setting the img1 dimensions back to 2px x 2px when the overlay is closed, but the same thing happens...Once the img1 dimensions are set to 2x2px, they stay that way even when a new thumbnail is clicked.
I'm developing an image slider. I'd like to be able to trigger functions when the mouse leaves an area, sort of like
$('#someDiv').mouseout or $('#someDiv').mouseleave
except instead of passing the div to the function I have a dimension I'd like to pass to it.
I have box like so[code]...
I have calculated the dimensions from the left of the box to 25% of the width of the box to the right (or 100px from the left of the box) and also calculated the height of the box and top offset. I want to be able to say if the mouse leaves those dimensions, run a function.
Can I pass the dimensions and use mouseout or mouseleave? is this possible without using an HTML element?
I am building an all AJAX site for a Facebook iFrame page and am having an issue. All the pages and what not load up dynamically just fine, but some pages use the Facebook commet system. After the AJAX has loaded the page though, the JavaScript inside does not load.
This is the Facebook comment script that I need to load inside the ajax'd content.