0

I have downloaded the code from http://bl.ocks.org/mbostock/raw/910126/ and I believe that I have also downloaded the correct json file (based on flare.json). However, when I run the script the sunburst chart is completely black and apparently due to error "d.parent.data is undefined" in the color function:

.attr("fill", function(d) { 
   return color(
      (d.children ? d : d.parent).data.key); 
      })

Other than changing the json file the code matches the example code. The only other difference is that I am running the code as a Drupal node.

VividD
  • 10,456
  • 6
  • 64
  • 111
PatriciaW
  • 893
  • 1
  • 12
  • 30

1 Answers1

0

Interesting. I modded the code a bit to get to colors and text - http://jsfiddle.net/LxGv2/

Two changes:

1) for color :

.attr("fill", function (d) {
    return color(d.value);;
})

2) for text:

text(function (d) {
    return d.key;
})

Hope this helps.

kgu87
  • 2,050
  • 14
  • 12