steven mcdowell
steven mcdowell

Reputation: 573

jQPlot in IE (Using rePlot or reDraw)

I'm using the jqplot plugin to display gauge on an site. This runs perfectly in FF/Safari/Chrome but have to use excanvas to run in IE8.

The problem is that the gauges are created dynamically, and so values are passed through and then the replot() function is needed to place the 'needle' in a position on the gauge. When I use the replot() or redraw() function in IE however, the axis are rendered but the actual gauge is displayed in the completely wrong place (I can only see the very top corner of the gauge inside the element).

I've read that forcing IE8 to emulate IE7 using

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> 

can solve this issue, but it hasn't effected the output in any way for me.

If there's anything else I need to include just say.

Upvotes: 3

Views: 6170

Answers (3)

Brandon Ferrara
Brandon Ferrara

Reputation: 1378

try using:

<meta http-equiv="X-UA-Compatible" content="IE=8" /> 

It worked for me even though i was already using IE8

Upvotes: 1

Jeff
Jeff

Reputation: 846

I use JQPLot quit a bit for one of my programs that specifically targets IE8 customers (corporate network), I have had numerous anomalies when I had additional plugins added. I would start by removing any JQPlot plugins you can first as that has helped me iron out some oddities I've run into with JQPLot.

I've also found firebug lite to be faster than developer tools for my CSS issues, yours sounds like it could just be a CSS issue. It would help to first inspect that element to see what CSS is being applied/overridden. You might be able to add an IE CSS conditional, http://www.quirksmode.org/css/condcom.html. Finally, your DOCTYPE will make a big difference in how IE renders your content: http://www.quirksmode.org/css/quirksmode.html.

If all the above doesn't work, I've stepped through a couple JQPlot issues just by loading the uncompressed JS and breaking at the function I need. If using IE developer tools, just giving a generic throw('fail') to break is much faster than trying to deal with IE Developer Tools' JS breakpoint system.

Upvotes: 2

Richard
Richard

Reputation: 6344

  1. Make sure you're on the latest version of jQuery (per here).

  2. Make sure that you're initializing your jPlot using the .Ready function (per here). $(document).ready(function() {

    $.jqplot(...init options...);

    });

  3. Make sure to include jquery.jqplot.css (per here)

  4. Disable the custom security setting in IE8 called "Binary and script behaviors" (per here)

Finally, it could be a bug. Try posting the issue here.

It sounds like jqPlot is pretty buggy at this point for IE8/9. You might try searching their site to see if they have some solutions.

Upvotes: 2

Related Questions