Chart (experimental) example

Multiple rows of data

Where more than one series is shown on a chart, do not hide the legend.

How it looks (preview)

Page views chart

This chart shows page views for January in different years.
This chart is a visual representation of the data available in the table.
Skip to "Page views chart" data table

How to call this example

<%= render "govuk_publishing_components/components/chart", {
  chart_heading: "Page views chart",
  h_axis_title: "Day",
  v_axis_title: "Views",
  chart_overview: "This chart shows page views for January in different years.",
  keys: [
    "1st",
    "2nd",
    "3rd",
    "4th",
    "5th",
    "6th",
    "7th",
    "8th",
    "9th",
    "10th"
  ],
  rows: [
    {
      label: "January 2015",
      values: [
        5,
        119,
        74,
        82,
        27,
        45,
        11,
        21,
        67,
        43
      ]
    },
    {
      label: "January 2016",
      values: [
        5,
        8,
        37,
        50,
        43,
        29,
        67,
        61,
        14,
        91
      ]
    },
    {
      label: "January 2017",
      values: [
        31,
        81,
        12,
        15,
        52,
        61,
        143,
        27,
        18,
        34
      ]
    }
  ]
} %>