Skip to content

Commit

Permalink
Add YAML content and data for a statistics block
Browse files Browse the repository at this point in the history
Statistics data will be read in from a CSV to be provided by departments
and then converted into a chart in the statistics block on landing
pages.

It is assumed that users will not need to be able to download the CSV
files directly and that a link will be provided to an externally hosted
data source, e.g. ONS data.
  • Loading branch information
leenagupte committed Oct 9, 2024
1 parent 1d8104f commit 5994ccf
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/data/landing_page_content_items/landing_page.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,18 @@ blocks:
- type: big_number
number: £43
label: Cost of a cup of coffee in Covent Garden
- type: statistics
title: "Chart to visually represent data"
x_axis_label: "X Axis"
y_axis_label: "Y Axis"
csv_file: "data_one.csv"
data_source_link_text: "Data source"
data_source_link: https://www.ons.gov.uk/economy/grossdomesticproductgdp/timeseries/ihyq/qna
- type: statistics
title: "Chart to visually represent data"
x_axis_label: "X Axis"
y_axis_label: "Y Axis"
csv_file: "data_two.csv"
data_source_link_text: "Data source"
data_source_link: https://www.ons.gov.uk/economy/inflationandpriceindices/timeseries/l55o/mm23

7 changes: 7 additions & 0 deletions lib/data/landing_page_content_items/statistics/data_one.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Date,variable,value
2024-01-01,variable_name,10
2024-02-01,variable_name,11
2024-03-01,variable_name,12
2024-04-01,variable_name,13
2024-05-01,variable_name,14
2024-06-01,variable_name,15
7 changes: 7 additions & 0 deletions lib/data/landing_page_content_items/statistics/data_two.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Date,variable,value
2023-01-01,variable_name,20
2023-02-01,variable_name,21
2023-03-01,variable_name,22
2023-04-01,variable_name,23
2023-05-01,variable_name,24
2023-06-01,variable_name,25
7 changes: 7 additions & 0 deletions spec/fixtures/landing_page.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,11 @@ blocks:
- type: big_number
number: £43
label: Cost of a cup of coffee in Covent Garden
- type: statistics
title: "Chart to visually represent data"
x_axis_label: "X Axis"
y_axis_label: "Y Axis"
csv_file: "data_one.csv"
data_source_link_text: "Data source"
data_source_link: https://www.example.com

7 changes: 7 additions & 0 deletions spec/fixtures/landing_page_statistics_data/data_one.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Date,variable,value
2024-01-01,variable_name,10
2024-02-01,variable_name,11
2024-03-01,variable_name,12
2024-04-01,variable_name,13
2024-05-01,variable_name,14
2024-06-01,variable_name,15

0 comments on commit 5994ccf

Please sign in to comment.