Highcharts Demo
author(s):
Torstein Hønsi
by Alexey Zakharov
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<div id="container" style="height: 400px; min-width: 310px; max-width: 600px; margin: 0 auto"></div>
CSS
.highcharts-tooltip h3 {
margin: 0.3em 0;
}
.highcharts-credits {
display: none;
}
JavaScript
Highcharts.chart('container', {
chart: {
type: 'bubble',
plotBorderWidth: 1,
zoomType: ''
},
title: false,
legend: {
enabled: false
},
xAxis: {
gridLineWidth: 1,
labels: {
format: '{value} m<sup>2</sup>'
},
lineColor: '#c2e2f0',
plotLines: [{
color: 'black',
dashStyle: 'dot',
width: 5,
value: 0,
label: {
rotation: 0,
y: 15,
style: {
fontStyle: 'italic'
},
text: 'Safe fat intake 65g/day'
},
zIndex: 3
}]
},
yAxis: {
startOnTick: false,
endOnTick: false,
labels: {
format: '{value} R'
},
lineColor: '#c2e2f0',
title: '',
maxPadding: 0.2,
plotLines: [{
color: '#',
dashStyle: 'dot',
width: 5,
value: 0,
label: {
align: 'right',
style: {
fontStyle: 'italic'
},
text: 'Safe sugar intake 50g/day',
x: -10
},
zIndex: 3
}]
},
tooltip: {
useHTML: true,
headerFormat: '<table>',
pointFormat: '<tr><th colspan="2"><h3>{point.country}</h3></th></tr>' +
'<tr><th>Fat intake:</th><td>{point.x}g</td></tr>' +
'<tr><th>Sugar intake:</th><td>{point.y}g</td></tr>' +
'<tr><th>Obesity (adults):</th><td>{point.z}%</td></tr>',
footerFormat: '</table>',
followPointer: true
},
plotOptions: {
series: {
dataLabels: {
enabled: true,
format: '{point.name}'
}
}
},
series: [{
data: [
{ x: 95, y: 95, z: 13.8, name: '', country: 'Belgium' },
...