Sorting method in d3js not working
问题 In this bar chart you can sort by clicking the "sort values" checkbox, it works initialy, but if you try to uncheck the box again it stops working. I get no errors from this either, I suspect that it has something to do with data not being loaded properly or some part of my code is structured poorly. Here's a Plunker 回答1: The reason for the unchecking of the sort values to NOT work was the sortIndex . As the data was being sorted, the original data itself was manipulated and the new sortIndex