The CSV example doesn't work in Internet Explorer 11


« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by matteo on 1st October 2015
Hello,
    I'm trying to implement a graph that get data from CSV.
I've cut'n'pasted the example from www.rgraph.net/docs/csv-file-reader.html but while it works fine in FireFox 41 it produce no output in MSIE11 both with and without compatibility view.

How to solve??? I'm using FF to develop the script but I need to have it working under MSIE!!!

here is my script, the CSV is available in above mentioned rgraph webpage.

<html>
<head>
<script src="ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js\"></script>
<script src="RGraph/libraries/RGraph.common.core.js"></script>
<script src="RGraph/libraries/RGraph.drawing.yaxis.js"></script>
<script src="RGraph/libraries/RGraph.bar.js"></script>

  <script type="text/javascript" src="RGraph/libraries/RGraph.line.js"></script>
     <script type="text/javascript" src="RGraph/libraries/RGraph.common.csv.js" ></script>


</head>
<body>
<canvas id="cvs" width="600" height="250" !style="border: 1px solid #ccc">
     [No canvas support]
</canvas>
<script>
     window.onload = function ()
     {
         /**
         * This fetchs the CSV file and shows the Bar chart
         */
         var csv = new RGraph.CSV('sample.csv', function (csv)
         {
             // Get the first column which becomes the labels
             var labels = csv.getCol(0);
            
             // Get the number of rows in the CSV
             var numrows = csv.numrows;

             // Get the number of cols in the CSV
             var numcols = csv.numcols;

             // Get the second column which becomes the data
             var data = csv.getCol(1);
            
            
             // Create the chart
             var bar = new RGraph.Bar({
                 id: 'cvs',
                 data: data,
                 options: {
                     labels: labels,
                     title: 'A chart using the CSV reader',
                     colors: ['red'],
                     strokestyle: 'white',
                     noxaxis: true,
                     shadowColor: '#aaa'
                 }
             }).draw()
         })
     }
</script>
</body>
</html>
Posted by Richard Heyes on 1st October 2015
Hi there,

This one works in IE11 - so you could use the code from that as a starting point.

PS Did you notice that all of the angle brackets on your tags are reversed?



Richard
Posted by Richard Heyes on 1st October 2015
Hi there,

This one even:

www.rgraph.net/demos/bar-csv-reader.html



Richard

Add a reply




« Back to message list