Highcharts Demo
author(s):
Torstein Hønsi
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="width: 600px; height: 400px"></div>
JavaScript
/**
* Highcharts plugin for axis crossing at specific value
*
* Note: xAxis must have opposite: true
*/
(function (H) {
H.wrap(H.Axis.prototype, 'getOffset', function (proceed) {
var chart = this.chart,
otherAxis;
proceed.call(this);
if (typeof this.options.crossing === 'number') {
otherAxis = chart[this.isXAxis ? 'yAxis' : 'xAxis'][0];
this.offset = otherAxis.toPixels(this.options.crossing, true);
chart.axisOffset[this.side] = 10;
}
});
}(Highcharts));
$(function () {
$('#container').highcharts({
"series": [{
"dataNameType": "text",
"dataLabels": {
"enabled": false
},
"pointPadding": 0,
"shadow": false,
"name": "Series 1",
"data": [{
"y": 443.07
}, {
"y": 204.11
}, {
"y": 47.56
}, {
"y": 190.5
}
],
"type": "column",
"groupPadding": 0.125
}
],
"yAxis": [{
"gridLineDashStyle": "Dash",
"title": {
"text": ""
},
"minorGridLineWidth": 0,
"lineColor": "#000000",
"tickColor": "#c4c4c4",
"gridLineColor": "rgba(192,192,192,0.25)",
"labels": {
"enabled": true,
"style": {
"fontWeight": "normal",
"color": "#000000",
"textAlign": "left",
"fontFamily": "Verdana",
"fontSize": "10.0pt"
}
},
"lineWidth": 1,
...