8 Replies Latest reply: Nov 25, 2013 10:27 AM by Brian Munz RSS

    Extension issue

      Hello, I have  a problem in implementing an extension into my qvw.

      The code  is the following one:

       

       

      <!DOCTYPE html>

      <html>

      <body>

       

      <script src="http://d3js.org/d3.v3.min.js"></script>

      <script src="http://d3js.org/topojson.v1.min.js"></script>

      <script src="http://datamaps.github.io/scripts/datamaps.world.min.js"></script>

      <div id="container" style="position: relative; width: 500px; height: 300px;"></div>

      <script>

          var map = new Datamap({

              element: document.getElementById('container'),

              fills: {

                  defaultFill: 'rgba(23,48,210,0.9)' //any hex, color name or rgb/rgba value

              }

          });

      </script>

       

      </body>

      </html>

       

      and it's working fine ; the libraries are working and the javascript code is working fibe.

       

      I tried to implement it in qlikview:

       

      Qva.LoadScript("http://datamaps.github.io/scripts/datamaps.world.min.js", function() {

      Qva.LoadScript("http://d3js.org/topojson.v1.min.js", function() {

      Qva.LoadScript("http://d3js.org/d3.v3.min.js", function() {

      Qva.AddExtension('map2', function() {

       

      var html="";

      var _this = this;

       

      html='<div id="container"; style="position: relative; width: 300px; height: 140px;"></div>';

       

      var map = new Datamap({

              element: document.getElementById('container'),

              fills: {

                  defaultFill: 'rgba(23,48,210,0.9)' //any hex, color name or rgb/rgba value

              }

          });

       

       

      this.Element.innerHTML+=html;

      },true);

      });

      });

      });

      and I receive the following error:

      'An error has occured in the script on this page

      LINE: 0

      CHAR: 0

      ERROR: Script error

      CODE: 0

      url: http://d3js.org/d3.v3.min.js

       

      Can you please help me? Thank you very much!