1 Reply Latest reply: Mar 24, 2016 6:59 AM by Erik Wetterberg RSS

    Visualization API

    Gustav Lindström

      I am trying to use the Visualization API in an mashup and I get the following error;

      "TypeError: Cannot read property 'create' of undefined(…)"

      the app object doesn't contain any visualization object. Does anyone know why?

       

      I have tried to followed the documentasion

      Visualization API ‒ Qlik Sense

       

      This is the code;

       

      self = this;var config = {host: "xxxxx.xxxxx.se",

      //prefix: "/",

      prefix: "/tds/",

      port: 443,

      isSecure: true};

       

      require.config({baseUrl: ( config.isSecure ? "https://" : "http://" ) + config.host + (config.port ? ":" + config.port: "") + config.prefix + "resources"});

       

      require(["js/qlik"], function ( qlik ) {qlik.setOnError( function ( error ) {alert( error.message );});

      var app = qlik.openApp('8d211ba9-1088-478d-a636-7b6b6cd770f6', config);

      app.visualization.create('barchart',["Account ID","=Count([Account ID])"], //problem here

      {title:"On the fly barchart"}

      ).then(function(vis){

      vis.show("QV04");

      });

      });

      }

      })