Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flot and Internet Explorer 9?

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 :)

like image 408
newtogit Avatar asked Mar 08 '11 18:03

newtogit


2 Answers

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]-->
like image 123
Ryley Avatar answered Oct 23 '22 13:10

Ryley


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

like image 27
jordancpaul Avatar answered Oct 23 '22 12:10

jordancpaul