JavaScript
var bedford = {
x: ['2009-10', '2010-11', '2011-12', '2012-13', '2013-14', '2014-15', '2015-16', '2016-17', '2017-18', '2018-19'],
y: [2812, 2654, 2828, 3051, 2261, 2496, 2611, 2515, 2530, 2527],
name: 'Bedford',
mode: 'lines+markers',
line: {
color: 'rgb(128,191,255)',
width: 2
}
};
var birmingham = {
x: ['2009-10', '2010-11', '2011-12', '2012-13', '2013-14', '2014-15', '2015-16', '2016-17', '2017-18', '2018-19'],
y: [975, 894, 881, 971, 947, 1098, 1046, 830, 800, 676],
name: 'Birmingham',
mode: 'lines+markers',
line: {
color: 'rgb(230,0,0)',
width: 2
}
};
var data = [bedford, birmingham];
var layout = {
title: 'Second Tier Clubs Average Attendances',
xaxis: {
title: 'Season',
type: 'category',
zeroline: false,
showline: false,
},
yaxis: {
title: 'Attendance',
range: [0, 3500],
zeroline: false,
showline: false,
}
};
Plotly.newPlot('attendanceDiv', data, layout);