Show values on top of bars in a barChart

Check updated jsfiddle .renderlet(function(chart){ var barsData = []; var bars = chart.selectAll(‘.bar’).each(function(d) { barsData.push(d); }); //Remove old values (if found) d3.select(bars[0][0].parentNode).select(‘#inline-labels’).remove(); //Create group for labels var gLabels = d3.select(bars[0][0].parentNode).append(‘g’).attr(‘id’,’inline-labels’); for (var i = bars[0].length – 1; i >= 0; i–) { var b = bars[0][i]; //Only create label if bar height is tall enough if … Read more

Loading external csv file in jsfiddle

The approach I usually use for CSV data in JSFiddle examples is a. Put the data in a <pre> block at the end of the HTML mark-up, usually with the id “data”. b. Add pre {display:none;} to the CSS. c. Replace the d3.csv(filename, callback) function call with a d3.csv.parse(text) call, using the text content of … Read more

Is there a way to tell crossfilter to treat elements of array as separate records instead of treating whole array as single key?

Solved it myself, here’s fiddle with working code http://jsfiddle.net/uhXf5/6/ Here’s code in case someone will came across similar problem: function reduceAdd(p, v) { v.tags.forEach (function(val, idx) { p[val] = (p[val] || 0) + 1; //increment counts }); return p; } function reduceRemove(p, v) { v.tags.forEach (function(val, idx) { p[val] = (p[val] || 0) – 1; … Read more