Chart (experimental) example
Bar chart
How it looks (preview)
Hats owned
This chart shows page views for January 2015.
This chart is a visual representation of the data available in the table.
View data as a table
| Hats owned | |
|---|---|
| Jon | 3 |
| Ash | 1 |
| James | 1 |
| Phil | 2 |
How to call this example
<%= render "govuk_publishing_components/components/chart", {
chart_type: "bar",
heading: "Hats owned",
h_axis_title: "Day",
v_axis_title: "Views",
description: "This chart shows page views for January 2015.",
hide_legend: true,
keys: [
"Jon",
"Ash",
"James",
"Phil"
],
rows: [
{
label: "Hats owned",
values: [
3,
1,
1,
2
]
}
]
} %>