Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
enricocamerin
Creator
Creator

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