1 <?php ob_start('ob_gzhandler') ?>
7 * o------------------------------------------------------------------------------o
8 * | This file is part of the RGraph package - you can learn more at: |
10 * | http://www.rgraph.net |
12 * | This package is licensed under the RGraph license. For all kinds of business |
13 * | purposes there is a small one-time licensing fee to pay and for non |
14 * | commercial purposes it is free to use. You can read the full license here: |
16 * | http://www.rgraph.net/LICENSE.txt |
17 * o------------------------------------------------------------------------------o
20 <title>RGraph: HTML5 canvas graph library - Microsoft Internet Explorer support</title>
22 <meta name="keywords" content="rgraph html5 canvas docs msie" />
23 <meta name="description" content="RGraph: HTML5 canvas graph software - Documentation about Microsoft Internet Explorer (MSIE) support" />
25 <link rel="stylesheet" href="../css/website.css" type="text/css" media="screen" />
26 <link rel="icon" type="image/png" href="/favicon.png">
28 <script src="../libraries/RGraph.common.core.js" ></script>
29 <script src="../libraries/RGraph.common.context.js" ></script>
30 <script src="../libraries/RGraph.line.js" ></script>
31 <script src="../libraries/RGraph.modaldialog.js" ></script>
32 <!--[if IE 8]><script src="../excanvas/excanvas.compressed.js"></script><![endif]-->
36 background-color: #dfd;
38 border: 2px dashed green;
45 <!-- Social networking buttons -->
46 <script src="../libraries/RGraph.common.core.js" ></script>
49 function HideTwitterDIV ()
51 document.getElementById("twitter_div").style.opacity = 0;
52 document.getElementById("twitter_div").style.display = 'none';
56 function ShowTwitterDIV (e)
58 var e = RGraph.FixEventObject(document.all ? event : e);
59 var div = document.getElementById("twitter_div");
60 var img = document.getElementById("twitter_icon");
62 div.style.display = 'block';
63 div.style.left = (RGraph.getCanvasXY(img)[0] + img.offsetWidth - div.offsetWidth + 110) + 'px';
64 div.style.top = (RGraph.getCanvasXY(img)[1] - 1) + 'px';
69 setTimeout('document.getElementById("twitter_div").style.opacity = 0.2;', 25);
70 setTimeout('document.getElementById("twitter_div").style.opacity = 0.4;', 50);
71 setTimeout('document.getElementById("twitter_div").style.opacity = 0.6;', 100);
72 setTimeout('document.getElementById("twitter_div").style.opacity = 0.8;', 125);
73 setTimeout('document.getElementById("twitter_div").style.opacity = 1.0;', 150);
81 * This code installs the event handler that hides the Twitter DIV
84 window.attachEvent('onload', function () {document.body.attachEvent('onclick', HideTwitterDIV);});
86 window.addEventListener('click', HideTwitterDIV, false);
90 <!-- The twitter DIV -->
91 <div id="twitter_div" style="position: absolute;top: 0;left: 0;background-color: #eee;border: 2px dashed black;box-shadow: 0 0 15px #aaa;-moz-box-shadow: 0 0 15px #aaa;-webkit-box-shadow: 0 0 15px #aaa;padding: 3px;display: none;opacity: 0;z-index: 99;">
92 <a href="http://twitter.com/home/?status=RGraph%3A+HTML5+canvas+graph+library+based+on+the+HTML5+canvas+tag+http%3A%2F%2Fwww.rgraph.net+%23rgraph+%23html5+%23canvas" target="_blank" title="Share on Twitter" rel="nofollow" style="text-decoration: none">Tweet about RGraph</a><br>
93 <a href="http://twitter.com/_rgraph" style="text-decoration: none" rel="nofollow" target="_blank">Follow for HTML5 news</a>
96 <div id="social_icons" class="warning" style="top: 0; left: 5px; position: absolute">
99 if (navigator.userAgent.indexOf('Opera') == -1) {
100 document.getElementById("social_icons").style.position = 'fixed';
101 document.getElementById("twitter_div").style.position = 'fixed';
106 <b style="display: inline-block; position: relative; top: 1px">Bookmark and share:</b>
110 <a title="Bookmark with delicious" href="http://delicious.com/save?jump=close&v=4&noui&jump=close&url=http://www.rgraph.net¬es=RGraph%20is%20a%20HTML5%20based%20graph%20library%20supporting%20a%20wide%20range%20of%20different%20graph%20types:Bar,%20Bipolar,%20Donut,%20Funnel,%20Gantt,%20Horizontal%20Bar,%20LED,%20Line,%20Meter,%20Odometer,%20Pie,%20Progress%20Bar,%20Rose,%20RScatter,%20Scatter%20and%20Traditional%20Radar&title=RGraph:%20HTML5%20canvas%20graph%20library%20based%20on%20the%20HTML5%20canvas%20tag" target="_blank">
111 <img src="../images/delicious.png" alt="Bookmark with delicious" width="22" height="22" border="0" align="absmiddle" />
114 <a href="" target="_blank" onmouseover="if (document.getElementById('twitter_div').style.display == 'none') ShowTwitterDIV(event);" onclick="event.stopPropagation(); event.cancelBubble = true; return false">
115 <img src="../images/twitter.png" id="twitter_icon" alt="tweet this site" width="22" height="22" border="0" align="absmiddle" />
120 <a title="Post to Google Buzz!" href="" onclick="window.open('http://www.google.com/buzz/post?url=http://www.rgraph.net&imageurl=http://www.rgraph.net/images/logo.png', 'google_buzz_window', 'width=800,height=400,top=100,left=100'); return false">
121 <img src="../images/buzz.png" width="22" height="22" alt="Post to Google Buzz!" align="absmiddle" style="position: relative; top: -2px; border: 0" border="0"/>
125 <a title="Share RGraph on Facebook" href="" onclick="window.open('http://www.facebook.com/sharer.php?u=http://www.rgraph.net&t=RGraph:%20HTML5%20canvas%20graph%20library', 'facebook_window', 'width=500,height=300,top=100,left=100'); return false">
126 <img src="../images/facebook.png" width="22" height="22" alt="Post to Facebook" align="absmiddle" style="position: relative; top: -2px; border: 0" border="0"/>
129 <a href="mailto:share@friendfeed.com" title="Share on FriendFeed">
130 <img src="../images/friendfeed.png" width="22" height="22" alt="Share on FriendFeed" border="0" align="absmiddle" />
133 <a href="http://www.stumbleupon.com/submit?url=http://www.rgraph.net" target="_blank" title="Share on StumbleUpon" >
134 <img src="../images/stumble.png" alt="Stumble! this site" width="22" height="22" border="0" align="absmiddle" />
139 <!-- /Social networking buttons -->
141 <div id="breadcrumb">
142 <a href="../index.html">RGraph: HTML5 canvas graph library</a>
144 <a href="index.html">Documentation</a>
149 <h1>RGraph: HTML5 canvas graph library - Microsoft Internet Explorer (MSIE) support</h1>
152 if (RGraph.isIE8()) {
153 document.write('<div style="background-color: #fee; border: 2px dashed red; padding: 5px"><b>Important</b><br /><br /> Internet Explorer 8 does not natively support the HTML5 canvas tag, so if you want to see the graphs, you can either:<ul><li>Install <a href="http://code.google.com/chrome/chromeframe/">Google Chrome Frame</a></li><li>Use ExCanvas. This is provided in the RGraph Archive.</li><li>Use another browser entirely. Your choices are Firefox 3.5+, Chrome 2+, Safari 4+ or Opera 10.5+. </li></ul> <b>Note:</b> Internet Explorer 9 fully supports the canvas tag. Click <a href="http://groups.google.com/group/rgraph/browse_thread/thread/c5651ff8c56b8f3c#" target="_blank">here</a> to see some screenshots.</div>');
160 <b>Microsoft Internet Explorer 9</b>
163 Starting from preview 3, Internet Explorer 9 has support for canvas, including the text and shadow APIs. It also
164 benefits from hardware acceleration, and quick rendering times. You can see some screenshots
165 <a href="http://groups.google.com/group/rgraph/browse_thread/thread/c5651ff8c56b8f3c#" target="_blank">here</a>.
171 <canvas id="myLine" width="600" height="250" style="float: right">[No canvas support]</canvas>
175 window.onload = function ()
177 var data1 = [4,3,6,8,4,2,1,4,9,8,7,8];
178 var data2 = [1,2,4,2,1,3,5,6,6,5,3,5];
180 // No "var" as the variable has to be global
181 line = new RGraph.Line('myLine', data1, data2);
182 line.Set('chart.title', 'Sales for Acme Inc. (context menu)');
183 line.Set('chart.title.vpos', 0.5);
184 line.Set('chart.colors', ['red', 'black']);
185 line.Set('chart.linewidth', 5);
187 // Odd, but this seems to fix an odd MSIE bug where the text is truncated
188 line.Set('chart.units.post', '% .');
190 line.Set('chart.yaxispos', 'right');
191 line.Set('chart.key', ['2007', '2008']);
192 line.Set('chart.key.background', 'white');
193 line.Set('chart.noaxes', true);
194 line.Set('chart.gutter', 35);
195 line.Set('chart.hmargin', 10);
196 line.Set('chart.background.barcolor1', 'white');
197 line.Set('chart.background.barcolor2', 'white');
198 line.Set('chart.shadow', true);
199 line.Set('chart.background.grid.autofit', true);
200 line.Set('chart.contextmenu', [['Show dialog', function () {ModalDialog.Show('myDialog', 300);}], ['Cancel', function () {}]]);
206 <li><a href="#introduction">Introduction</a></li>
207 <li><a href="#getting">Getting hold of ExCanvas</a></li>
208 <li><a href="#caveats">Caveats</a></li>
209 <li><a href="#frame">Google Chrome Frame</a></li>
210 <li><a href="#dynamic.canvas">Using a dynamically created canvas</a></li>
213 <a name="introduction"></a>
214 <h4>Introduction</h4>
217 As of December 2009 RGraph now works partially with Internet Explorer without Google Chrome Frame.
218 Graphs are rendered as VML. You are still recommended to use
219 <a href="http://code.google.com/chrome/chromeframe/">Google Chrome Frame</a> to get the best results.
220 The interactive features are unlikely to work correctly. RGraph only works with Microsoft
225 Thanks go to everyone involved with the <a href="http://code.google.com/p/explorercanvas/" target="_blank" rel="nofollow">ExCanvas project</a> for providing the ExCanvas library.
228 <a name="getting"></a>
229 <h4>Getting hold of ExCanvas</h4>
232 Google ExCanvas is distributed with RGraph in the "excanvas" directory. There is a minified gzip compressed version, along
236 <a name="caveats"></a>
240 <li>The interactive features of RGraph are unlikely to work correctly with MSIE 8.</li>
241 <li>Shadows are now available (on some graph types), albeit without blurring.</li>
242 <li>You must reference the Javascript libraries in the documents <head>.</li>
243 <li>You must use the window.onload event to create your graph.</li>
245 Inside the window.onload function your graph must be created as a <i>local</i> variable (ie you must use the <i>var</i> keyword). Eg:
248 window.onload = function ()
250 <span style="color: green">var</span> myGraph = new RGraph.Bar('myCanvas', [1,9,8,7,3,4,8,4,9,5,7,8]);
251 myGraph.Set('chart.labels', ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']);
257 <li>If your page is large, there may be a slight pause before the window.onload event fires and thus creates the graph.</li>
258 <li>Changing the font that text is shown in is not available.</li>
262 <h4>Google Chrome Frame</h4>
264 Instead of ExCanvas you can also use Google Chrome Frame. This basically turns Internet Explorer into Google Chrome, and fully
265 supports RGraph. Since it involves a plugin installation, this is a better option if you can fully influence the users PC. If you
266 can fully influence the users PC however, a better option might be to simply use one of the browsers with native
274 <a name="dynamic.canvas"></a>
275 <h4>Using a dynamically created canvas</h4>
277 If you're creating your canvas dynamically there is an extra step that you must perform to allow it to be recognised by
282 var canvas = document.createElement('CANVAS');
286 canvas.style.border = '1px dashed black';
287 document.body.appendChild(canvas);
289 <span style="color: green">G_vmlCanvasManager.initElement(canvas);</span>
298 <!-- This is the ModdalDialog -->
299 <div id="myDialog" style="display: none">
300 <div style="text-align: center; font-family: Arial">
301 <h4>Please wait...</h4>
302 <span style="font-size: 8pt">(Nothing is going to happen, this is simply an example <a href="" onclick="ModalDialog.Close(); return false">Close</a>)</span>