US-China
by Adam Nekola
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 400px; height: 200px; margin: 0 auto"></div>
JavaScript
$(function () {
$('#container').highcharts({
chart: {
type: 'scatter',
zoomType: 'xy',
style: {
fontFamily: '"franklin-gothic-urw", Verdana, Geneva, sans-serif'
}
},
title: {
text: ''
},
subtitle: {
text: ''
},
exporting: {
enabled: false
},
credits: {
enabled: false
},
xAxis: {
title: {
enabled: false
},
min: 0,
startOnTick: true,
endOnTick: true,
showFirstLabel: false,
showLastLabel: false,
tickInterval: 20,
offset: 15,
lineColor: '#fff',
tickColor: '#fff',
labels: {
formatter: function() {
return this.value + '%';
}
}
},
yAxis: {
title: {
text: ''
},
max: 4,
min: 1,
labels: {
formatter: function() {
if (this.value == 1) {
return 'Iran';
} else if (this.value == 2) {
return 'Saudi Arabia';
} else if (this.value == 3) {
return 'China';
} else if (this.value == 4){
return 'U.S.';
}
},
style: {
fontWeight: 'bold',
fontFamily: '"franklin-gothic-urw", Verdana, Geneva, sans-serif'
}
}
},
...