anychart.onDocumentReady(function () {
var chart = anychart.bar();
'Formation and evolution<br/>of the Solar System',
'Giant impact hypothesis<br/>(Earth\'s Moon formation)',
['Origin of water on Earth', 120, 545, 86, 156, 93],
['Conception of Darwinism', 203, 304, 92, 311, 90],
['Linnaean classification<br/>of organisms', 110, 144, 69, 321, 356],
['Historical materialism<br/>by Karl Marx', 100, 447, 39, 119, 295]
var createSeries = function (columnNumber, name) {
for (var i = 0; i < surveyData.length; i++) {
var value = surveyData[i][columnNumber] / 10;
var center = surveyData[i][3] / 10 / 2;
if (name === 'Don\'t care') {
} else if (name === 'Not completely agree') {
} else if (name === 'Agree') {
low: center + surveyData[i][4] / 10,
high: center + surveyData[i][4] / 10 + value,
} else if (name === 'Not completely disagree') {
} else if (name === 'Disagree') {
low: -center - surveyData[i][2] / 10,
high: -center - surveyData[i][2] / 10 - value,
var series = chart.rangeBar(data);
series.name(name).stroke('3 #fff 1').selectionMode('none');
series.hovered().stroke('3 #fff 1');
series.tooltip().title().useHtml(true).fontSize(12);
createSeries(1, 'Disagree');
createSeries(2, 'Not completely disagree');
createSeries(3, 'Don\'t care');
createSeries(4, 'Not completely agree');
createSeries(5, 'Agree');
'<span style="color:#212121; font-size: 13px;">(According to survey 1000 in ACME corp.)</span>'
.items(['#ef6c00', '#ffa000', '#96a6a6', '#42a5f5', '#1976d2'])
.position('center-bottom');
chart.yScale().stackMode('value');
chart.xAxis().ticks(false);
chart.yAxis(1).orientation('top');
return Math.abs(this.value) + '%';
.titleFormat(function () {
this.getData('value') * 10 +
'<span style="font-size: 13px; color: #cbcbcb">(' +
if (this.seriesName === 'Don\'t care') {
' about <br/><span style="color: #cbcbcb">' +
' with <br/><span style="color: #cbcbcb">' +
chart.lineMarker().value(0).stroke('#CECECE');
chart.container('container');