D3.js using ordinal scale over linear scale
问题 Why is it better to use this instead of a linear scale for making an ordered bar chat? The argument that I've heard is that this can keep the data sets in order, but can't this also be done if one sets the index number of the individual data as the x-coordinate? dataset = [ 5, 10, 13, 19, 21, 25, 22, 18, 15, 13]; var xScale = d3.scale.ordinal() .domain(d3.range(dataset.length)) 回答1: The reason you should use an ordinal scale instead of a linear scale is simple, although a lot of people get