Flot and Internet Explorer 9?
Asked Answered
S

4

5

I am just about to choose a chart library for my ASP.NET application.

I had my eye on flot which is also used by stackoverflow. When I go to the flot examples here: http://people.iola.dk/olau/flot/examples/

They look great. But not in IE9. I don't see anything in IE9. If I put my IE9 into IE8 or IE7 mode it works. If I go to the User page here on SO

https://stackoverflow.com/users/22656/jon-skeet?tab=reputation

it works also in IE9. What am I missing? Is there a secret SupportIE9=true switch?

I had a look at protovis as an alternative. http://vis.stanford.edu/protovis/ex/

That looks great in IE9 but if I put the browser into IE7 or IE8 it is depressing again.

Hints? How to make these work or an alternative which works cross-IE-version? Firefox is not in issue. Works with all libraries :)

Spontaneous answered 8/3, 2011 at 18:53 Comment(0)
W
9

Get the latest version of flot (currently 0.8.3).

There are some changes since around version (0.6) that pretain to IE9, specifically, the way IE6-8 support canvas is via a library called excanvas. IE9 now supports canvas natively, so the inclusion of excanvas should only happen if the user doesn't have IE9. The specific change in the subversion repository for flot is this one:

http://code.google.com/p/flot/source/detail?r=293

An example of the change you need to make is this:

<!--[if IE]><script language="javascript" type="text/javascript" src="../excanvas.min.js"></script><![endif]-->

Becomes this:

<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../excanvas.min.js"></script><![endif]-->
Womanhater answered 8/3, 2011 at 21:26 Comment(1)
Thx for the answer @Ryley, thus flot it is going to be :)Spontaneous
S
3

You should give gRaphael a shot. Excellent performance, even in IE, and well featured. Here are some results: https://gist.github.com/275992

Seem answered 8/3, 2011 at 19:41 Comment(4)
That's what I have today. At least for one of my diagrams. A date axis has been a real pain. I'd like to try something else.Spontaneous
Not sure why this was downvoted...the original question clearly stated that the asker wanted to know How to make these work or an alternative which works cross-IE-version?Seem
+1, I agree! (although I think my answer is pretty good too :p )Womanhater
I didn't do the downvote and I just accepted the answer of Ryley :)Spontaneous
S
0

If you want to stick to the same version and fix the issue, this should help. http://bugs.endian.com/view.php?id=3813

Syllabogram answered 19/3, 2012 at 17:44 Comment(0)
P
0

flot is ok in IE9, but IE9 is not ok with some JavaScript syntax.

Debugging the same problem as described have revealed the error with data array defined as:

$.plot($("#fig2"), [
{...},
{...},
], options});

IE thinks of that array as having 3 members, so a cycle in flot got broken. So clear array syntax from odd closing comma!

Philbert answered 24/10, 2013 at 8:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.