Highcharts add image on export

2019-03-06 15:26发布

问题:

Im using Highcharts with the export feature, from what I understand to add images to the chart I can use the renderer which works fine however I do not want the image (a logo) to appear on the chart in the app I want it to appear only on export, how would I be able to do this?

回答1:

You should use chartOptions object and then catch load event where you place renderer code.

exporting:{
                chartOptions:{
                    chart:{
                        events:{
                            load:function(){
                                this.renderer.image('http://highcharts.com/demo/gfx/sun.png', 100, 100, 30, 30)
                .add();

                            }
                        }
                    }
                }
    },

Example: http://jsfiddle.net/rLfj69b9/2/