Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

DenDrogram issue for me

Hello Team

   I am using this following link  for creating the DenDiagram, Once i copied and opened the html file i could not able to see any output. Is this code is incomplete

i copied the code at the same folder is R/d3.v3.min.js

                                                              R/flare.json    - this is copied from the site

                                                              R/Den.html

The html code is as followes. Am i need to do any other stuff rather than these three codes.Looking your kind advice

Labels (1)
3 Replies
Not applicable
Author

Here is my code.

<!DOCTYPE html>
<meta charset="utf-8">
<title>Flare Dendrogram</title>
<style>

.node circle {
  fill: #fff;
  stroke: steelblue;
  stroke-width: 1.5px;
}

.node {
  font: 10px sans-serif;
}

.link {
  fill: none;
  stroke: #ccc;
  stroke-width: 1.5px;
}

</style>
<body>
<script src="d3.v3.min.js"></script>
<script type="text/javascript">

var radius = 960 / 2;

var cluster = d3.layout.cluster()
    .size([360, radius - 120]);

var diagonal = d3.svg.diagonal.radial()
    .projection(function(d) { return [d.y, d.x / 180 * Math.PI]; });

var svg = d3.select("body").append("svg")
    .attr("width", radius * 2)
    .attr("height", radius * 2)
  .append("g")
    .attr("transform", "translate(" + radius + "," + radius + ")");

d3.json("flare.json", function(error, root) {

  var nodes = cluster.nodes(root);

  var link = svg.selectAll("path.link")
      .data(cluster.links(nodes))
    .enter().append("path")
      .attr("class", "link")
      .attr("d", diagonal);

  var node = svg.selectAll("g.node")
      .data(nodes)
    .enter().append("g")
      .attr("class", "node")
      .attr("transform", function(d) { return "rotate(" + (d.x - 90) + ")translate(" + d.y + ")"; })

  node.append("circle")
      .attr("r", 4.5);

  node.append("text")
      .attr("dy", ".31em")
      .attr("text-anchor", function(d) { return d.x < 180 ? "start" : "end"; })
      .attr("transform", function(d) { return d.x < 180 ? "translate(8)" : "rotate(180)translate(-8)"; })
      .text(function(d) { return d.name; });
});

d3.select(self.frameElement).style("height", radius * 2 + "px");

</script>

Not applicable
Author

anychart
Partner - Specialist
Partner - Specialist

For anyone landing here who needs a dendrogram in Qlik: we've recently released a Circular Dendrogram extension for Qlik Sense, native chart, radial layout, deep hierarchies on one screen. Worth a look if this thread brought you here.
➡️ Learn more & check it out

circular_dendogram_selections_19818d9625