So I made this prototype chart -- and wanted to create a kind of birdseye view -- of a pyramid type chart.
So for example with foursquare -- restaurants, butchers, cafes -- would have different attributes associated - like count, chekin, popularity
This is a version 3 of the chart. http://jsfiddle.net/0ht35rpb/33/
This is the version 4 https://jsfiddle.net/pLo6mubx/
var color = d3.scaleOrdinal()
.range(["#a8e6cf", "#dcedc1", "#ffd3b6", "#ffaaa5"]);
-- but I am unsure if the colors are correct - as if the count is small in series A -- is it consistent when looking at the other series -- the size of the circle may change - but its really just its layer. I want to make sure the data is represented correctly - and that the colors are correct throughout the circles themselves and the legend. - Also if there is a way to clean up the diagonally pointing labels - it gets messy as the overall size of the group may change -- so that's causing the angle to change.
so the chart itself should be correct as its recalling the data index
circles.enter().append("circle")
.attr("cy", height / 2)
.attr("cx", 0)
.attr("r", function(d) {
return scale(Math.sqrt(d.value));
})
.style("fill", function(d) {
return color(d.index);
});
but the legend is using just a one series of data and just looping through the colors.
ring.enter().append("circle")
.attr("cy", function(d, i) {
return (vertical * i) + ringRadius;
})
.attr("r", ringRadius)
.attr("width", ringRadius*2)
.attr("height", ringRadius*2)
.style("fill", function(d, i) {
return color(i);
});
- Fix the the pointer label displacements -- the angles are coming off at odd and sharp angles -- its as if the labels 200,500,4000,200 -- need to be in relative position to EACH parent pyramid -- and then off-set to the right by the same amount like 100px?
- CHECK and/or CORRECT -- the colors in the legend and in the circles themselves -- I am not sure the legend is a true representative of the way the colors are being used -- the colors on the chart should be consistent throughout - but I think the way the circles are plotting their fill colors and the way the legend does it - are relying on different indexes -- please check/correct
June 8th - latest version - https://jsfiddle.net/e8bmyvra/1/ - remaining "fix the the pointer label displacements"


