Given the Post model above, you can create a bar chart that shows the number of posts per author with just three lines of YAML and one line in the view:

To create the chart on the right, simply add the following YAML file and call render_report in any view:

YAML

config/reports_kit/reports/demo.yml

measure: post dimensions: - author

View

app/views/my_controller/my_view.html.haml

= render_report 'demo'