@ons/design-system 72.4.0 → 72.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/components/button/_button.scss +171 -3
  2. package/components/button/_macro.njk +4 -0
  3. package/components/card/_card.scss +5 -0
  4. package/components/card/_macro.njk +10 -2
  5. package/components/card/_macro.spec.js +58 -0
  6. package/components/card/example-card-set-with-headline-figures.njk +62 -0
  7. package/components/chart/_chart.scss +80 -0
  8. package/components/chart/_macro.njk +125 -0
  9. package/components/chart/_macro.spec.js +825 -0
  10. package/components/chart/annotations-options.js +78 -0
  11. package/components/chart/bar-chart.js +164 -0
  12. package/components/chart/chart-constants.js +21 -0
  13. package/components/chart/chart.dom.js +8 -0
  14. package/components/chart/chart.js +242 -0
  15. package/components/chart/column-chart.js +48 -0
  16. package/components/chart/common-chart-options.js +247 -0
  17. package/components/chart/example-bar-chart-with-annotations.njk +62 -0
  18. package/components/chart/example-bar-chart.njk +55 -0
  19. package/components/chart/example-bar-with-line-chart.njk +64 -0
  20. package/components/chart/example-clustered-bar-chart.njk +60 -0
  21. package/components/chart/example-clustered-column-chart.njk +74 -0
  22. package/components/chart/example-column-chart-with-annotations.njk +62 -0
  23. package/components/chart/example-column-chart.njk +54 -0
  24. package/components/chart/example-column-with-line-chart.njk +62 -0
  25. package/components/chart/example-line-chart-with-annotations.njk +235 -0
  26. package/components/chart/example-line-chart.njk +221 -0
  27. package/components/chart/example-stacked-bar-chart.njk +60 -0
  28. package/components/chart/example-stacked-column-chart.njk +67 -0
  29. package/components/chart/line-chart.js +42 -0
  30. package/components/chart/specific-chart-options.js +22 -0
  31. package/components/footer/_footer.scss +12 -0
  32. package/components/footer/_macro.njk +38 -17
  33. package/components/header/_header.scss +18 -2
  34. package/components/header/_macro.njk +81 -8
  35. package/components/header/_macro.spec.js +97 -0
  36. package/components/header/example-header-with-search-button.njk +190 -0
  37. package/components/header/header.spec.js +128 -0
  38. package/components/hero/_hero.scss +39 -7
  39. package/components/hero/_macro.njk +47 -17
  40. package/components/hero/_macro.spec.js +94 -0
  41. package/components/hero/example-hero-grey.njk +9 -0
  42. package/components/icon/_macro.njk +8 -8
  43. package/components/input/_input.scss +15 -0
  44. package/components/input/_macro.njk +3 -3
  45. package/components/navigation/navigation.dom.js +17 -0
  46. package/components/navigation/navigation.js +72 -2
  47. package/components/pagination/_pagination.scss +7 -1
  48. package/components/summary/_macro.njk +1 -1
  49. package/components/summary/_macro.spec.js +6 -0
  50. package/components/table-of-contents/_macro.njk +40 -0
  51. package/components/table-of-contents/_macro.spec.js +72 -0
  52. package/components/table-of-contents/_table-of-contents.scss +11 -0
  53. package/components/table-of-contents/example-table-of-contents-related-links-with-button.njk +60 -0
  54. package/css/main.css +1 -1
  55. package/js/cookies-functions.js +11 -6
  56. package/js/cookies-functions.spec.js +44 -0
  57. package/js/main.js +2 -0
  58. package/package.json +4 -1
  59. package/scripts/main.es5.js +1 -1
  60. package/scripts/main.js +1 -1
  61. package/scss/main.scss +1 -0
  62. package/scss/utilities/_grid.scss +13 -4
@@ -0,0 +1,247 @@
1
+ import ChartConstants from './chart-constants';
2
+
3
+ // Options that are common to all chart types - these are set once in the Highcharts.setOptions() method
4
+ class CommonChartOptions {
5
+ constructor() {
6
+ this.constants = ChartConstants.constants();
7
+
8
+ this.options = {
9
+ chart: {
10
+ backgroundColor: 'transparent',
11
+ style: {
12
+ fontFamily: '"OpenSans", "Helvetica Neue", arial, sans-serif',
13
+ color: '#222222',
14
+ },
15
+ },
16
+ legend: {
17
+ align: 'left',
18
+ verticalAlign: 'top',
19
+ layout: 'horizontal',
20
+ // Symbol width and height are set in a postLoad event, depending on the series type
21
+ // Default to the line width to ensure there is enough space for the overall legend item for line symbols
22
+ symbolWidth: 20,
23
+ margin: 50,
24
+ navigation: {
25
+ // ensures that when the legend is long, there is no pagination or scrollbar
26
+ enabled: false,
27
+ },
28
+ itemDistance: 30,
29
+ itemHoverStyle: {
30
+ color: this.constants.labelColor, // Prevents the text from changing color on hover
31
+ },
32
+ itemStyle: {
33
+ cursor: 'default', // ensures that it does not change to a hand (pointer) on hover.
34
+ color: this.constants.labelColor,
35
+ fontSize: this.constants.desktopFontSize,
36
+ fontWeight: 'normal',
37
+ },
38
+ // Disable click event on legend
39
+ // There is currently an issue because the legend items are still buttons
40
+ // and therefore the screen reader still announces that they can be clicked
41
+ events: {
42
+ itemClick: () => {
43
+ return false;
44
+ },
45
+ },
46
+ accessibility: {
47
+ keyboardNavigation: {
48
+ enabled: false, // Prevents focus on legend items while keeping screen reader support
49
+ },
50
+ },
51
+ },
52
+ // Remove the chart title as rendered by Highcharts, as this is rendered in the surrounding component
53
+ title: {
54
+ text: '',
55
+ },
56
+ credits: {
57
+ // Remove Highcharts watermark
58
+ enabled: false,
59
+ },
60
+ accessibility: {
61
+ enabled: true,
62
+ },
63
+ yAxis: {
64
+ labels: {
65
+ style: {
66
+ color: this.constants.axisLabelColor,
67
+ fontSize: this.constants.desktopFontSize,
68
+ },
69
+ },
70
+ title: {
71
+ text: '', // Remove the default title rendered by Highcharts if not provided
72
+ align: 'high',
73
+ textAlign: 'middle',
74
+ reserveSpace: false,
75
+ useHTML: true,
76
+ offset: 15,
77
+ rotation: 0,
78
+ y: -25,
79
+ style: {
80
+ color: this.constants.axisLabelColor,
81
+ fontSize: this.constants.desktopFontSize,
82
+ },
83
+ },
84
+ lineColor: this.constants.gridLineColor,
85
+ gridLineColor: this.constants.gridLineColor,
86
+ // Add zero line
87
+ plotLines: [
88
+ {
89
+ color: this.constants.zeroLineColor,
90
+ width: 1,
91
+ value: 0,
92
+ zIndex: 2,
93
+ },
94
+ ],
95
+ // Add tick marks
96
+ tickWidth: 1,
97
+ tickLength: 6,
98
+ tickColor: this.constants.gridLineColor,
99
+ },
100
+ xAxis: {
101
+ labels: {
102
+ style: {
103
+ color: this.constants.axisLabelColor,
104
+ fontSize: this.constants.desktopFontSize,
105
+ },
106
+ },
107
+ title: {
108
+ align: 'high',
109
+ style: {
110
+ color: this.constants.axisLabelColor,
111
+ fontSize: this.constants.desktopFontSize,
112
+ },
113
+ },
114
+ lineColor: this.constants.gridLineColor,
115
+ gridLineColor: this.constants.gridLineColor,
116
+ // Add tick marks
117
+ tickWidth: 1,
118
+ tickLength: 6,
119
+ tickColor: this.constants.gridLineColor,
120
+ },
121
+ plotOptions: {
122
+ series: {
123
+ // disables the tooltip on hover
124
+ enableMouseTracking: false,
125
+ animation: false,
126
+
127
+ // disables the legend item hover
128
+ states: {
129
+ inactive: {
130
+ opacity: 1, // Prevent dimming of other series
131
+ enabled: false,
132
+ },
133
+ hover: {
134
+ enabled: false, // Disable the hover effect
135
+ },
136
+ },
137
+ },
138
+ },
139
+ };
140
+ }
141
+
142
+ getOptions = () => this.options;
143
+
144
+ getMobileOptions = () => {
145
+ return {
146
+ legend: {
147
+ itemStyle: {
148
+ fontSize: this.constants.mobileFontSize,
149
+ },
150
+ },
151
+ xAxis: {
152
+ labels: {
153
+ style: {
154
+ fontSize: this.constants.mobileFontSize,
155
+ },
156
+ },
157
+ title: {
158
+ style: {
159
+ fontSize: this.constants.mobileFontSize,
160
+ },
161
+ },
162
+ },
163
+ yAxis: {
164
+ labels: {
165
+ style: {
166
+ fontSize: this.constants.mobileFontSize,
167
+ },
168
+ },
169
+ title: {
170
+ style: {
171
+ fontSize: this.constants.mobileFontSize,
172
+ },
173
+ },
174
+ },
175
+ };
176
+ };
177
+
178
+ hideDataLabels = (series) => {
179
+ series.forEach((series) => {
180
+ series.update({
181
+ dataLabels: {
182
+ enabled: false,
183
+ },
184
+ });
185
+ });
186
+ };
187
+
188
+ disableLegendForSingleSeries = (config) => {
189
+ if (config.series.length === 1) {
190
+ config.legend = {
191
+ enabled: false,
192
+ };
193
+ config.chart.marginTop = 50;
194
+ }
195
+ };
196
+
197
+ updateLegendSymbols = (chart) => {
198
+ if (chart.legend.options.enabled) {
199
+ chart.legend.allItems.forEach((item) => {
200
+ const { legendItem, userOptions } = item;
201
+ const seriesType = userOptions?.type;
202
+ // symbol is defined for bar / column series, and line is defined for line series
203
+ // if symbol is defined for a line series, it is the marker symbol
204
+ const { label, symbol } = legendItem || {};
205
+
206
+ if (seriesType === 'line') {
207
+ symbol?.attr({
208
+ x: 16, // Position the marker to the right of the line
209
+ });
210
+
211
+ label?.attr({
212
+ x: 30, // Adjust label position to account for longer line
213
+ });
214
+ } else {
215
+ // Set the symbol size for bar / column series
216
+ symbol.attr({
217
+ width: 12,
218
+ height: 12,
219
+ y: 8,
220
+ });
221
+ }
222
+ });
223
+ }
224
+ };
225
+
226
+ adjustChartHeight = (currentChart, percentageHeightDesktop, percentageHeightMobile) => {
227
+ // get height and width of the plot area
228
+ const plotHeight = currentChart.plotHeight;
229
+ const plotWidth = currentChart.plotWidth;
230
+ // calculate the new plot height based on the percentage height
231
+ // default to the current height
232
+ let newPlotHeight = plotHeight;
233
+ if (plotWidth > 400) {
234
+ newPlotHeight = plotWidth * (percentageHeightDesktop / 100);
235
+ } else {
236
+ newPlotHeight = plotWidth * (percentageHeightMobile / 100);
237
+ }
238
+ const totalHeight = currentChart.plotTop + newPlotHeight + currentChart.marginBottom;
239
+
240
+ // set the new size of the chart
241
+ if (totalHeight !== currentChart.chartHeight) {
242
+ currentChart.setSize(null, totalHeight, false);
243
+ }
244
+ };
245
+ }
246
+
247
+ export default CommonChartOptions;
@@ -0,0 +1,62 @@
1
+ {% from "components/chart/_macro.njk" import onsChart %}
2
+
3
+ {{
4
+ onsChart({
5
+ "chartType": "bar",
6
+ "description": "Volume sales, seasonally adjusted, Great Britain, January 2022 to January 2025",
7
+ "theme": "primary",
8
+ "title": "Food stores showed a strong rise on the month, while non-food stores fell",
9
+ "subtitle": "Figure 6: Upward contribution from housing and household services (including energy) saw the annual CPIH inflation rate rise",
10
+ "id": "uuid",
11
+ "caption": "Source: Monthly Business Survey, Retail Sales Inquiry from the Office for National Statistics",
12
+ "download": {
13
+ 'title': 'Download Figure 1 data',
14
+ 'itemsList': [
15
+ {
16
+ "text": "Excel spreadsheet (XLSX format, 18KB)",
17
+ "url": "#"
18
+ },
19
+ {
20
+ "text": "Simple text file (CSV format, 25KB)",
21
+ "url": "#"
22
+ },
23
+ {
24
+ "text": "Image (PNG format, 25KB)",
25
+ "url": "#"
26
+ }
27
+ ]
28
+ },
29
+ "xAxis": {
30
+ "categories": [
31
+ "All retailing",
32
+ "All retailing excluding Automotive fuel",
33
+ "Food stores",
34
+ "Department stores",
35
+ "Other non-food stores",
36
+ "Textile clothing \u0026 footwear stores",
37
+ "Household goods stores",
38
+ "Non-store retailing",
39
+ "Automotive fuel"
40
+ ],
41
+ "type": "linear"
42
+ },
43
+ "yAxis": {
44
+ "title": "Percent (%)"
45
+ },
46
+ "series": [
47
+ {
48
+ "data": [1.7, 2.1, 5.6, 0, -0.6, -2.7, -1.7, 2.4, -1.2],
49
+ "dataLabels": true,
50
+ "name": "Jan-25"
51
+ }
52
+ ],
53
+ "annotations": [
54
+ {
55
+ "text": "A test annotation",
56
+ "point": {"x": 2, "y": 3},
57
+ "labelOffsetX": 40,
58
+ "labelOffsetY": -30
59
+ }
60
+ ]
61
+ })
62
+ }}
@@ -0,0 +1,55 @@
1
+ {% from "components/chart/_macro.njk" import onsChart %}
2
+
3
+ {{
4
+ onsChart({
5
+ "chartType": "bar",
6
+ "description": "Volume sales, seasonally adjusted, Great Britain, January 2022 to January 2025",
7
+ "theme": "primary",
8
+ "title": "Food stores showed a strong rise on the month, while non-food stores fell",
9
+ "subtitle": "Figure 6: Upward contribution from housing and household services (including energy) saw the annual CPIH inflation rate rise",
10
+ "id": "uuid",
11
+ "caption": "Source: Monthly Business Survey, Retail Sales Inquiry from the Office for National Statistics",
12
+ "download": {
13
+ 'title': 'Download Figure 1 data',
14
+ 'itemsList': [
15
+ {
16
+ "text": "Excel spreadsheet (XLSX format, 18KB)",
17
+ "url": "#"
18
+ },
19
+ {
20
+ "text": "Simple text file (CSV format, 25KB)",
21
+ "url": "#"
22
+ },
23
+ {
24
+ "text": "Image (PNG format, 25KB)",
25
+ "url": "#"
26
+ }
27
+ ]
28
+ },
29
+ "xAxis": {
30
+ "categories": [
31
+ "All retailing",
32
+ "All retailing excluding Automotive fuel",
33
+ "Food stores",
34
+ "Department stores",
35
+ "Other non-food stores",
36
+ "Textile clothing \u0026 footwear stores",
37
+ "Household goods stores",
38
+ "Non-store retailing",
39
+ "Automotive fuel"
40
+ ],
41
+ "title": "Retailing",
42
+ "type": "linear"
43
+ },
44
+ "yAxis": {
45
+ "title": "Percent (%)"
46
+ },
47
+ "series": [
48
+ {
49
+ "data": [1.7, 2.1, 5.6, 0, -0.6, -2.7, -1.7, 2.4, -1.2],
50
+ "dataLabels": true,
51
+ "name": "Jan-25"
52
+ }
53
+ ]
54
+ })
55
+ }}
@@ -0,0 +1,64 @@
1
+ {% from "components/chart/_macro.njk" import onsChart %}
2
+
3
+ {{
4
+ onsChart({
5
+ "chartType": "bar",
6
+ "description": "Volume sales, seasonally adjusted, Great Britain, January 2022 to January 2025",
7
+ "theme": "primary",
8
+ "title": "Food stores showed a strong rise on the month, while non-food stores fell",
9
+ "subtitle": "Figure 6: Upward contribution from housing and household services (including energy) saw the annual CPIH inflation rate rise",
10
+ "id": "uuid",
11
+ "caption": "Source: Monthly Business Survey, Retail Sales Inquiry from the Office for National Statistics",
12
+ "download": {
13
+ 'title': 'Download Figure 1 data',
14
+ 'itemsList': [
15
+ {
16
+ "text": "Excel spreadsheet (XLSX format, 18KB)",
17
+ "url": "#"
18
+ },
19
+ {
20
+ "text": "Simple text file (CSV format, 25KB)",
21
+ "url": "#"
22
+ },
23
+ {
24
+ "text": "Image (PNG format, 25KB)",
25
+ "url": "#"
26
+ }
27
+ ]
28
+ },
29
+ "legend": true,
30
+ "xAxis": {
31
+ "categories": ["One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten"],
32
+ "type": "linear",
33
+ "title": "Categories"
34
+ },
35
+ "yAxis": {
36
+ "title": "Percent (%)"
37
+ },
38
+ "series": [
39
+ {
40
+ "data": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
41
+ "dataLabels": true,
42
+ "name": "Values"
43
+ },
44
+ {
45
+ "data": [
46
+ ["One", 6],
47
+ ["Two", 4],
48
+ ["Three", 5],
49
+ ["Four", 7],
50
+ ["Five", 2],
51
+ ["Six", 9],
52
+ ["Seven", 3],
53
+ ["Eight", 8],
54
+ ["Nine", 2],
55
+ ["Ten", 1]
56
+ ],
57
+ "marker": true,
58
+ "dataLabels": false,
59
+ "name": "Another test data source",
60
+ "type": "line"
61
+ }
62
+ ]
63
+ })
64
+ }}
@@ -0,0 +1,60 @@
1
+ {% from "components/chart/_macro.njk" import onsChart %}
2
+
3
+ {{
4
+ onsChart({
5
+ "chartType": "bar",
6
+ "description": "Volume sales, seasonally adjusted, Great Britain, January 2022 to January 2025",
7
+ "theme": "primary",
8
+ "title": "Food stores showed a strong rise on the month, while non-food stores fell",
9
+ "subtitle": "Figure 6: Upward contribution from housing and household services (including energy) saw the annual CPIH inflation rate rise",
10
+ "id": "uuid",
11
+ "caption": "Source: Monthly Business Survey, Retail Sales Inquiry from the Office for National Statistics",
12
+ "download": {
13
+ 'title': 'Download Figure 1 data',
14
+ 'itemsList': [
15
+ {
16
+ "text": "Excel spreadsheet (XLSX format, 18KB)",
17
+ "url": "#"
18
+ },
19
+ {
20
+ "text": "Simple text file (CSV format, 25KB)",
21
+ "url": "#"
22
+ },
23
+ {
24
+ "text": "Image (PNG format, 25KB)",
25
+ "url": "#"
26
+ }
27
+ ]
28
+ },
29
+ "legend": true,
30
+ "series": [
31
+ {
32
+ "data": [-6.2, 1.5, -15.9, 1.7],
33
+ "dataLabels": false,
34
+ "name": "2022"
35
+ },
36
+ {
37
+ "data": [-2.9, -2.7, -2.9, -3.5],
38
+ "dataLabels": false,
39
+ "name": "2023"
40
+ },
41
+ {
42
+ "data": [-1.6, 1.2, 3.2, 3.8],
43
+ "dataLabels": false,
44
+ "name": "2024"
45
+ }
46
+ ],
47
+ "xAxis": {
48
+ "categories": [
49
+ "Food stores",
50
+ "Non-food stores",
51
+ "Non-store retailing ",
52
+ "Automotive fuel"
53
+ ],
54
+ "type": "linear"
55
+ },
56
+ "yAxis": {
57
+ "title": "Percent (%)"
58
+ }
59
+ })
60
+ }}
@@ -0,0 +1,74 @@
1
+ {% from "components/chart/_macro.njk" import onsChart %}
2
+
3
+ {{
4
+ onsChart({
5
+ "chartType": "column",
6
+ "description": "Volume sales, monthly percentage change, seasonally adjusted, Great Britain, October 2024",
7
+ "theme": "alternate",
8
+ "title": "Clothing stores fell back, following three months of growth",
9
+ "subtitle": "Volume sales, monthly percentage change, seasonally adjusted, Great Britain, October 2024",
10
+ "id": "uuid",
11
+ "caption": "Source: Monthly Business Survey, Retail Sales Inquiry from the Office for National Statistics",
12
+ "download": {
13
+ 'title': 'Download Figure 1 data',
14
+ 'itemsList': [
15
+ {
16
+ "text": "Excel spreadsheet (XLSX format, 18KB)",
17
+ "url": "#"
18
+ },
19
+ {
20
+ "text": "Simple text file (CSV format, 25KB)",
21
+ "url": "#"
22
+ },
23
+ {
24
+ "text": "Image (PNG format, 25KB)",
25
+ "url": "#"
26
+ }
27
+ ]
28
+ },
29
+ "legend": {
30
+ "enabled": true
31
+ },
32
+ "series": [
33
+ {
34
+ "data": [6.2, 1.5, 15.9, 1.7],
35
+ "dataLabels": false,
36
+ "name": "2022"
37
+ },
38
+ {
39
+ "data": [2.9, -2.7, 2.9, 3.5],
40
+ "dataLabels": false,
41
+ "name": "2023"
42
+ },
43
+ {
44
+ "data": [-1.6, 1.2, 3.2, 3.8],
45
+ "dataLabels": false,
46
+ "name": "2024"
47
+ },
48
+ {
49
+ "data": [3.0, 2, 5.6, 2.1],
50
+ "dataLabels": false,
51
+ "name": "2025"
52
+ },
53
+ {
54
+ "data": [2.0, 2, 3, 4],
55
+ "dataLabels": false,
56
+ "name": "2026"
57
+ }
58
+ ],
59
+ "xAxis": {
60
+ "categories": [
61
+ "Food stores",
62
+ "Non-food stores",
63
+ "Non-store retailing ",
64
+ "Automotive fuel"
65
+ ],
66
+ "type": "linear"
67
+ },
68
+ "yAxis": {
69
+ "title": "2022"
70
+ },
71
+ "percentageHeightDesktop": 35,
72
+ "percentageHeightMobile": 90
73
+ })
74
+ }}
@@ -0,0 +1,62 @@
1
+ {% from "components/chart/_macro.njk" import onsChart %}
2
+
3
+ {{
4
+ onsChart({
5
+ "chartType": "column",
6
+ "description": "Public sector net debt excluding public sector banks, percentage of gross domestic product (GDP), UK, financial year ending (FYE) 1901 to October 2024",
7
+ "theme": "primary",
8
+ "title": "Figure 6: Net debt as a percentage of GDP remains at levels last seen in the early 1960s",
9
+ "subtitle": "Public sector net debt excluding public sector banks, percentage of gross domestic product (GDP), UK, financial year ending (FYE) 1901 to October 2024",
10
+ "id": "uuid",
11
+ "caption": "Source: Public sector finances from the Office for Budget Responsibility (OBR) and the Office for National Statistics",
12
+ "download": {
13
+ 'title': 'Download Figure 1 data',
14
+ 'itemsList': [
15
+ {
16
+ "text": "Excel spreadsheet (XLSX format, 18KB)",
17
+ "url": "#"
18
+ },
19
+ {
20
+ "text": "Simple text file (CSV format, 25KB)",
21
+ "url": "#"
22
+ },
23
+ {
24
+ "text": "Image (PNG format, 25KB)",
25
+ "url": "#"
26
+ }
27
+ ]
28
+ },
29
+ "legend": false,
30
+ "series": [
31
+ {
32
+ "data": [
33
+ 37.8, 41.0, 43.0, 42.9, 41.8, 39.8, 37.9, 38.2, 37.6, 36.7,
34
+ 33.9, 31.8
35
+ ],
36
+ "dataLabels": false,
37
+ "name": "Public sector net debt as a % of GDP (PSND)"
38
+ }
39
+ ],
40
+ "xAxis": {
41
+ "categories": [
42
+ "Mar 1901", "Mar 1902", "Mar 1903", "Mar 1904", "Mar 1905", "Mar 1906", "Mar 1907", "Mar 1908", "Mar 1909", "Mar 1910",
43
+ "Mar 1911", "Mar 1912"
44
+ ],
45
+ "title": "Years",
46
+ "type": "linear"
47
+ },
48
+ "yAxis": {
49
+ "title": "Percentage of GDP"
50
+ },
51
+ "percentageHeightDesktop": 35,
52
+ "percentageHeightMobile": 90,
53
+ "annotations": [
54
+ {
55
+ "text": "A test annotation",
56
+ "point": {"x": 11, "y": 31.8},
57
+ "labelOffsetX": 10,
58
+ "labelOffsetY": -50
59
+ }
60
+ ]
61
+ })
62
+ }}
@@ -0,0 +1,54 @@
1
+ {% from "components/chart/_macro.njk" import onsChart %}
2
+
3
+ {{
4
+ onsChart({
5
+ "chartType": "column",
6
+ "description": "Public sector net debt excluding public sector banks, percentage of gross domestic product (GDP), UK, financial year ending (FYE) 1901 to October 2024",
7
+ "theme": "primary",
8
+ "title": "Figure 6: Net debt as a percentage of GDP remains at levels last seen in the early 1960s",
9
+ "subtitle": "Public sector net debt excluding public sector banks, percentage of gross domestic product (GDP), UK, financial year ending (FYE) 1901 to October 2024",
10
+ "id": "uuid",
11
+ "caption": "Source: Public sector finances from the Office for Budget Responsibility (OBR) and the Office for National Statistics",
12
+ "download": {
13
+ 'title': 'Download Figure 1 data',
14
+ 'itemsList': [
15
+ {
16
+ "text": "Excel spreadsheet (XLSX format, 18KB)",
17
+ "url": "#"
18
+ },
19
+ {
20
+ "text": "Simple text file (CSV format, 25KB)",
21
+ "url": "#"
22
+ },
23
+ {
24
+ "text": "Image (PNG format, 25KB)",
25
+ "url": "#"
26
+ }
27
+ ]
28
+ },
29
+ "legend": false,
30
+ "series": [
31
+ {
32
+ "data": [
33
+ 37.8, 41.0, 43.0, 42.9, 41.8, 39.8, 37.9, 38.2, 37.6, 36.7,
34
+ 33.9, 31.8
35
+ ],
36
+ "dataLabels": false,
37
+ "name": "Public sector net debt as a % of GDP (PSND)"
38
+ }
39
+ ],
40
+ "xAxis": {
41
+ "categories": [
42
+ "Mar 1901", "Mar 1902", "Mar 1903", "Mar 1904", "Mar 1905", "Mar 1906", "Mar 1907", "Mar 1908", "Mar 1909", "Mar 1910",
43
+ "Mar 1911", "Mar 1912"
44
+ ],
45
+ "title": "Years",
46
+ "type": "linear"
47
+ },
48
+ "yAxis": {
49
+ "title": "Percentage of GDP"
50
+ },
51
+ "percentageHeightDesktop": 35,
52
+ "percentageHeightMobile": 90
53
+ })
54
+ }}