Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Building a d3.v4 extension in qlik sense

I'm using the qlik sense extension editor in the cloud to create a d3 extension, and have put the d3 code in a local file, linking to it through the define statement at the top of the extension editor. This seems to work fine for d3.v3, but not for d3.v4. The console tells me that d3 is undefined.

Is there a way around this? Any help appreciated.

Thanks

Sarah

3 Replies
ErikWetterberg

What does your definiera statement look like? Do you get any other errors, like HTTP errors in the console?

Erik Wetterberg

Anonymous
Not applicable
Author

I had the same issue and here is what I've done to solve it

With v4, you have to put d3 as parameter of your function.

In your main.js file you have to declare d3 in your parameters likes this :

define( [

    "./lib/d3",

    "./lib/myfunctions"

    ],

    function ($, d3 ) {

        'use strict';

...

     // call of method from functions

     mymethod(param1, param2, d3);

In the myfunctions.js

function mymethod(param1, param2, d3){

     d3.select....

}

ajaykakkar93
Specialist III
Specialist III

I have attached a demo Extension it's not working & Base HTML file is also attached,
If you can help me with this it will be great.

Regards,

Ajay Kakkar

ajaykakkar93@gmail.com 

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting