So I have a bar chart that I want to sort in two stages, by a categorial variable first (that's the color in the attached examples) and then within those values sort it by a continuous variable. Here's the code that works everywhere except Chrome
// adapts histogram bars
histog.selectAll("rect")
.sort(function(a, b) {
//return a.win > b.win?-1:1;
return d3.ascending(a.win, b.win);
})
.sort(function(a, b) {
//return a.wkr > b.wkr?1:-1;
return d3.ascending(a.wkr, b.wkr);
})
Using d3 version 3.1.5 the desired output will show in Safari 6.0.3, Firefox 20.0, IE 10.0.9 and IE 9.0.8 (see attached reference rendering "safari-firefox.png") but will not work in Chrome (Version 26.0.1410.65, OSX 10.8.3 - see attached "chrome.png").
Is this a misuse of sorting and should nesting be used here or is something wrong with Chrome?
Thanks very much for any help in advance
Michael