Your data
Either two columns (category and count), or one column with a row for every occurrence — repeats are counted for you.
Chart settings
Group after: keep this many categories and put the rest into "Other". Use 0 to show them all.
Result
Paste data on the left to build your chart.