Obtaining bar charts with frequencies