Highcharts:添加自定义图像按钮

我想在highcharts上添加和图像按钮。 到目前为止,我已经成功创建了一个图像按钮,并在其上附加了一个点击事件。 但问题是,图像(sun.png)位于图表的左侧,图像按钮右对齐(工具栏的默认位置)。 对此有任何修复?

exporting: { buttons: { popUpBtn: { symbol: 'url(images/sun.png)', _titleKey: 'popUpBtnTitle', x: -10, symbolFill: '#B5C9DF', hoverSymbolFill: '#779ABF', onclick: function () { alert('ad'); popUpChart($(this)); } }, exportButton: { enabled: false }, printButton: { enabled: false } } } 

此外,如果还有其他方法可以在图表中添加具有click事件的图像,那么这些方法也是受欢迎的。

最后,我这样想出来了。 可能会帮助别人。

 function callback($this){ var img = $this.renderer.image('images/zoom_icon.png',$this.chartWidth-40,5,40,12); img.add(); img.css({'cursor':'pointer'}); img.attr({'title':'Pop out chart'}); img.on('click',function(){ // prcessing after image is clicked }); } new Highcharts.Chart(charts.params,callback); // where charts.params is object which contains options for chart