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

丶灬走出姿态 提交于 2019-11-29 18:14:24
Paweł Fus

You can use chart.exportChart() function to achieve that: http://jsfiddle.net/B6s7V/38/

The same solution as here.

$("#export").click(function () {
    chart.exportChart(null, {
        chart: {
            events: {
                load: function () {
                    this.renderer.image('http://highcharts.com/demo/gfx/sun.png', 100, 100, 30, 30).add();
                }
            }
        }
    });
});

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!