From 435c59c9ab79d1590692d372b5e1aa11bf51ea61 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Tue, 8 Dec 2009 12:31:49 -0800 Subject: [PATCH] IE compatibility notes --- docs/index.html | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/index.html b/docs/index.html index e75c9a4..b5dc38a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -56,6 +56,7 @@ +

Internet Explorer Compatibility

+ +

The dygraphs library relies heavily on HTML's <canvas> tag, which +Microsoft Internet Explorer does not support. Fortunately, some clever engineers +created the excanvas +library, which imlements the <canvas> tag in IE using VML.

+ +

You can add IE support to any page using dygraphs by including the following +in your page:

+ +
+<head>
+<!--[if IE]><script src="excanvas.js"></script><![endif]-->
+</head>
+
+ +

This works quite well in practice. Charts are responsive, even under VML +emulation.

+ +

One common gotcha to look out for: make sure you don't have any trailing +commas in parameter lists, e.g.

+ +
new Dygraph(el, data, {
+  showRoller:true,  // <-- note trailing comma
+})
+ +

Most browsers will ignore the trailing comma, but it will break under IE.

+

One last demo

This chart shows monthly closes of the Dow Jones Industrial Average, both in nominal and real (i.e. adjusted for inflation) dollars. The shaded areas show its monthly high and low. CPI values with a base from 1982-84 are used to adjust for inflation.

-- 2.7.4