(function () {
var highcharts = document.createElement('script');
var cdn = 'https://code.highcharts.com/';
var loaded = 0;
var encodedUrl = encodeURI('https://app.everviz.com//show/ahyboku');
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":"column","inverted":true,"style":{"fontFamily":"Arial"},"height":450},"plotOptions":{"series":{"dataLabels":{"enabled":true,"style":{"fontSize":"12px","color":"#000000"},"useHTML":true}}},"legend":{"y":80,"itemStyle":{"color":"#000000"},"verticalAlign":"top"},"credits":{"href":"prri.org","text":"PRRI"},"xAxis":{"minorGridLineWidth":0,"lineColor":"#d8d8d8","tickColor":"#d8d8d8","minorTickColor":"#d8d8d8","minorGridLineColor":"#d8d8d8","title":{"style":{"color":"#000000","fontSize":"10px"}}},"yAxis":{"tickColor":"#d8d8d8","gridLineWidth":0,"title":{"style":{"color":"#000000","fontSize":"10px"},"text":"Source: PRRI 2016 American Values Survey."},"lineWidth":1,"minorGridLineColor":"#d8d8d8","minorGridLineWidth":0,"lineColor":"#d8d8d8","tickInterval":10,"minorTickColor":"#d8d8d8","minColor":"#d8d8d8","tickWidth":1,"maxColor":"#d8d8d8"},"subtitle":{"style":{"fontSize":"14px","color":"#000000","fontWeight":"normal"},"text":"Thinking about the following characteristics and qualities, please say whether you think it applies more to Hillary Clinton or more to Donald Trump"},"tooltip":{"backgroundColor":"#ffffff"},"title":{"style":{"color":"#000000","fontWeight":"bold"},"text":"Public Attributes More Positive Qualities to Clinton than Trump"},"exporting":{"allowHTML":true},"series":[{"index":0,"color":"#275072"},{"index":1,"color":"#9e292c"}],"meta":{"js":{"lib":{"version":"1.0.012"}},"highcharts":{"version":"4.1.8"}},"data":{"csv":",Hillary Clinton,Donald Trump\nIs honest and trustworthy,45,44\nIs a strong and decisive leader,47,47\nHas strong religious beliefs,50,36\nCares about people like you,52,40\nWill use American military power responsibly,55,39\nUnderstands the problems of poor Americans,57,35\nHas the right temperament and personality to be president,61,33\nHas the right background and experience,64,31","seriesMapping":[{"x":0},{"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 = "Public Attributes More Positive Qualities to Clinton than Trump", // Set title for Twitter
myURL = "https://www.prri.org/research/divide-americas-future-1950-2050/"; // 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-ahyboku', 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/16315/2/view', true);
r.setRequestHeader('Content-Type', 'application/json');
r.send();
} catch (e) {
}
}());