Skip to main content

Integration, Extension & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
QlikWorld 2023, a live, in-person thrill ride. April 17 - 20, 2023, in Las Vegas! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
enricocamerin
Contributor III
Contributor III

D3.js collapsible tree diagram

Hello,

I'm trying to reuse a code from  3d      https://bl.ocks.org/d3noob/43a860bc0024792f8803bba8ca0d5ecd

I have problem converting the treeData  Object

the data source format  should be like this

var treeData =
  {
    "name": "Top Level",
    "children": [
      { 
        "name": "Level 2: A",
        "children": [
          { "name": "Son of A" },
          { "name": "Daughter of A" }
        ]
      },
      { "name": "Level 2: B" }
    ]
  }; 

How can I have this format reading from the hypercube ?

Starting with 2 dimensions the data Object come with this format

var qMatrix = layout.qHyperCube.qDataPages[0].qMatrix ;

var data =qMatrix.map(function (d) {

return {
          "dim1": d[0].qText ,
         "dim2": d[1].qText
            }
})



many thanks for your advice.

Regards

Enrico

Labels (1)
  • 3d.js

0 Replies