There seems to be something weird about IE8 and the way it handles csv data. My simple test code is below...
<!DOCTYPE html>
<html xmlns="
http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!--[if IE]><script type="text/javascript" src="/js/flot/excanvas.js"></script><![endif]-->
<title>Graph Test</title>
<script type="text/javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="/js/dygraph-combined.js"></script>
<script type="text/javascript">
var unitdata = "Date,Planned,Actual\n";
unitdata += "2013-02-11,120,120\n2013-02-12,120,100\n2013-02-13,120,140\n";
</script>
<script type="text/javascript">
$(document).ready(function() {
var g1 = new Dygraph(
document.getElementById("graphdiv1"),
'unitdata.csv',
{ }
);
});
</script>
</head>
<body>
<div id="graphdiv1" style="height:300px;"></div>
</body>
</html>
I am testing in IE 10, Browser Mode IE8 - Standards Mode IE8.
When I use the csv file, as above, it works fine. But if I use the inline data declared in the js in the header, it will not render the lines in IE8 Standards mode, but with with IE9 standards mode.
It appears to be some sort of timing thing. If I alert the data right before the call to dygraphs' constructor, the data is identical in both cases. The jquery 'document' construct ensures that nothing is done until the file is completely loaded. So why would IE8 NOT render a local string, but work properly on a file?
Summary:
csv file: IE8 Browser IE8 Standards -- works also works for all other IE9 and IE10 combos
local file: IE8 Browser IE8 Standards -- does NOT work. But as long as I set to IE9 standards, everything works fine no matter what the browser is set for , even IE8
Very odd....