Tag: axes

Highcharts:使X和Y轴相交为0

我试图让我的图表的X轴和Y轴始终相交为0。 目前,我正在拦截’load’事件,然后更改最初工作的轴的偏移,但是当调整窗口大小或放大图表时,轴不会更新。 即使调整窗口大小或图表缩放,如何将轴保持在0的中心位置? 这是我的小提琴和代码: http : //jsfiddle.net/a003mc4b/ $(function () { $(‘#container’).highcharts({ chart: { type: ‘scatter’, zoomType: ‘xy’, events: { load : function() { this.xAxis[0].update({ offset: -this.yAxis[0].translate(0) }); this.yAxis[0].update({ offset: -this.xAxis[0].translate(0) }); } }, }, title: { text: ‘X and Y axis should intersect at 0’ }, yAxis: { lineColor: ‘#FF0000’, lineWidth: 1 }, xAxis: { […]