(function () {
var highcharts = document.createElement('script');
var cdn = 'https://code.highcharts.com/';
var loaded = 0;
var encodedUrl = encodeURI('https://app.everviz.com//show/ijesiza');
var scripts = [
"stock/highstock.js",
"highcharts-more.js",
"highcharts-3d.js",
"modules/data.js",
"modules/exporting.js",
"modules/funnel.js",
"modules/solid-gauge.js",
"modules/annotations.js",
"modules/export-data.js",
"modules/accessibility.js"
/* "modules/series-label.js" */
];
var options = {"chart":{"type":"line","backgroundColor":"#ffffff","style":{"fontFamily":"Arial"}},"legend":{"y":18,"itemStyle":{"color":"#000000"},"verticalAlign":"top"},"credits":{"href":"publicreligion.org","text":"PRRI"},"xAxis":{"minorGridLineWidth":0,"lineColor":"#d8d8d8","labels":{"step":1,"rotation":-45},"tickColor":"#d8d8d8","minorTickColor":"#d8d8d8","minorGridLineColor":"#d8d8d8","title":{"style":{"fontSize":"10px","color":"#000000"},"text":"Sources: General Social Survey, 1976-2012; PRRI 2013-2016 Americans Values Atlas."}},"yAxis":{"tickColor":"#d8d8d8","gridLineWidth":0,"title":{"style":{"fontSize":"13px"}},"minorGridLineWidth":0,"minorGridLineColor":"#d8d8d8","lineWidth":1,"lineColor":"#d8d8d8","tickInterval":10,"minorTickColor":"#d8d8d8","min":0,"minColor":"#d8d8d8","tickWidth":1,"maxColor":"#d8d8d8"},"plotOptions":{"series":{"dataLabels":{"style":{"color":"#000000"},"format":"{x}"}}},"colors":{"0":"#76d155","1":"#434348","2":"#90ed7d","3":"#f7a35c","4":"#8085e9","5":"#f15c80","6":"#e4d354","7":"#2b908f","8":"#f45b5b","9":"#97e4de"},"subtitle":{"style":{"fontWeight":"normal","fontSize":"14px","color":"#000000"}},"tooltip":{"backgroundColor":"#ffffff"},"title":{"style":{"fontWeight":"bold","color":"#000000"},"text":"Growth of the Religiously Unaffiliated, 1976-2016"},"exporting":{"allowHTML":true},"series":[{"index":0,"marker":{"symbol":"circle"},"color":"#ca8abc"}],"meta":{"js":{"lib":{"version":"1.0.012"}},"highcharts":{"version":"4.1.8"}},"data":{"csv":"GSS YEAR FOR THIS RESPONDENT (1990-2012) AVA (2013-16),Percent of population\n1976,7\n1977,6\n1978,8\n1980,7\n1982,7\n1983,7\n1984,7\n1985,7\n1986,7\n1987,7\n1988,8\n1989,8\n1990,8\n1991,6\n1993,9\n1994,9\n1996,12\n1998,14\n2000,14\n2002,14\n2004,14\n2006,16\n2008,17\n2010,18\n2012,20\n2013,21\n2014,22\n2015,23\n2016,24","seriesMapping":[{"x":0}]}};
function isScriptAlreadyIncluded(src){
var scripts = document.getElementsByTagName("script");
for (var i = 0; i < scripts.length; i++) {
if (scripts[i].hasAttribute('src')) {
if ((scripts[i].getAttribute('src') || '').indexOf(src) >= 0) {
return true;
}
}
}
return false;
}
function createChart() {
if (typeof window['Highcharts'] !== 'undefined') {
if (options.yAxis && options.yAxis.length === 1) options.yAxis = options.yAxis[0];
if (options.xAxis && options.xAxis.length === 1) options.xAxis = options.xAxis[0];
if (options.zAxis && options.zAxis.length === 1) options.zAxis = options.zAxis[0];
// Sample from highcharts
var myTitle = "Growth of the Religiously Unaffiliated", // Set title for Twitter
myURL = "https://www.prri.org/research/american-religious-landscape-christian-religiously-unaffiliated/"; // Set URL to the article
var items = options.exporting && options.exporting.buttons &&
options.exporting.buttons.contextButton.menuItems,
encodedUrl = encodeURIComponent(myURL),
mySharers = [
[
'Share on Facebook'
],
[
'Share on Google+'
],
[
'Share on Twitter'
],
[
'Share on LinkedIn'
]
]
if (items) {
options.exporting.buttons.contextButton.menuItems = items.slice(0, -3);
Highcharts.each(mySharers, function (item, i){
options.exporting.buttons.contextButton.menuItems[i].text = item.join('');
});
}
if (options && (options.lang || options.global)) {
Highcharts.setOptions({
global: options.global || {},
lang: options.lang || {}
});
}
new Highcharts.Chart('highcharts-ijesiza', options);
}
}
function check() {
if (loaded === scripts.length) {
for (var i = 0; i < window.HighchartsCloud.ondone.length; i++) {
try {
window.HighchartsCloud.ondone[i]();
} catch(e) {
console.error(e);
}
}
}
window.HighchartsCloud.hasLoaded = true;
}
function loadScript(s) {
function next() {
++loaded;
if (loaded < scripts.length) {
loadScript(scripts[loaded]);
}
check();
}
if (isScriptAlreadyIncluded(s)) {
return next();
}
var n = document.createElement('script');
n.onload = function () {
next();
};
if (s.indexOf('https') >= 0) {
n.src = s;
} else {
n.src = cdn + s;
}
document.body.appendChild(n);
}
if (typeof window['HighchartsCloud'] === 'undefined') {
window.HighchartsCloud = {
ondone: [createChart],
hasWrapped: false,
hasLoaded: false
};
loadScript(scripts[0]);
} else {
if (window.HighchartsCloud.hasLoaded) {
createChart();
} else {
window.HighchartsCloud.ondone.push(createChart);
}
}
try {
var r = new XMLHttpRequest();
r.open('POST', 'https://api.everviz.com:443/chart/58809/5/view', true);
r.setRequestHeader('Content-Type', 'application/json');
r.send();
} catch (e) {
}
}());