Can not exporting renderer shapes added in callback function in highcharts / highstock

后端 未结 2 1060
半阙折子戏
半阙折子戏 2020-12-22 05:33

I want to dynamically added several primitive shapes like text and images into highcharts / highstock.

Please see this fiddle.

$(function () {
    v         


        
2条回答
  •  甜味超标
    2020-12-22 06:06

    When you export a chart, the chart SVG is regenerated from the original .Chart call. If you want to add things after the chart has drawn, do it in the charts:events:load callback.

        chart: {
            renderTo: 'container',
            spacingBottom: 50,
            events: {
                load: function(){
                    this.renderer.image('http://highcharts.com/demo/gfx/sun.png', 100, 100, 30, 30).add();
                }
            }
        }, 
    

    See updated fiddle here.

提交回复
热议问题