Using an ordinal scale ('d3.scale.ordinal') for the x-axis in a bar chart
问题 I have a data array like this: var data = [{"Alphabet_Type":"a"}, {"Alphabet_Type":"b"}, {"Alphabet_Type":"a"}]; I am using: dc.js crossfilter.js d3.js I want to create a bar chart with: the x-axis having an alphabet name, and the y-axis having number of occurrences of the alphabet. Question: How can I plot a bar chart with an ordinal scale on the x-axis? My code: var data = [{"Alphabet_Type":"a"}, {"Alphabet_Type":"b"}, {"Alphabet_Type":"a"}]; var Filter = crossfilter(data); var Dimension =