Highcharts test tool
by Torstein Hønsi
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="container"></div>
CSS
#container {
min-width: 300px;
max-width: 800px;
height: 300px;
margin: 1em auto;
}
JavaScript
Highcharts.wrap(Highcharts, 'formatSingle', function (proceed, format, val, time) {
if (format.indexOf('e') > -1) {
return val.toExponential();
}
return proceed.call(this, format, val, time);
});
Highcharts.chart('container', {
xAxis: {
categories: ['Apples', 'Pears', 'Bananas', 'Oranges']
},
yAxis: {
type: 'logarithmic'
},
series: [{
data: [Math.PI, 9999, 0.009, -9999],
type: 'column',
dataLabels: {
enabled: true,
format: '{y:e}'
}
}]
});