anychart.onDocumentReady(function () {
var dataSet = anychart.data.set(getData());
var firstSeriesData = dataSet.mapAs({ x: 0, value: 1 });
var secondSeriesData = dataSet.mapAs({ x: 0, value: 2 });
var thirdSeriesData = dataSet.mapAs({ x: 0, value: 3 });
var fourthSeriesData = dataSet.mapAs({ x: 0, value: 4 });
var chart = anychart.line();
chart.title('Acceptance of same-sex relationships in the US over the last 2 decades');
chart.yAxis().title('% of people who accept same-sex relationships');
var firstSeries = chart.line(firstSeriesData);
firstSeries.name('18-34');
var secondSeries = chart.line(secondSeriesData);
secondSeries.name('35-49');
var thirdSeries = chart.line(thirdSeriesData);
thirdSeries.name('50-64');
var fourthSeries = chart.line(fourthSeriesData);
fourthSeries.name('65+');
chart.legend().enabled(true);
chart.container('container');
['1990',16.9,12.2,10.2,5.2],
['1993',26.5,23.8,16.8,6.6],
['1994',28.7,22,17.3,9.1],
['1996',35.7,24,22.6,9.2],
['1998',37.2,24.6,22.4,11.2],
['2000',36.5,26.2,23.7,9.9],
['2002',40,34.4,23.8,16.4],
['2004',33.3,28.8,32.5,14.3],
['2006',40.2,32.1,27.5,15.1],
['2008',49.3,37.2,31.4,17.1],
['2010',51.9,42.5,36.1,28.5],
['2012',53.1,43.8,36,24.6],
['2014',63.7,45.9,44.7,31.3],
['2016',66.3,52,42.3,37.2],
['2018',70.1,57.7,49.2,39]