How to convert highchart to binary image

前端 未结 2 1575
眼角桃花
眼角桃花 2021-01-27 06:40

I\'am using highchart for plotting a graph with angular:

HTML:


         


        
2条回答
  •  一整个雨季
    2021-01-27 07:17

    Thanks, at last I got the answer:

    HTML:

    
    

    JS:

    var svg = document.getElementById('chart').children[0].innerHTML;
    //svg = chart.getSVG(); 
    
    var base_image = new Image();
    svg = "data:image/svg+xml," + svg;
    base_image.src = svg;
    $('#mock').attr('src', svg);
    

    We can save image tag directly in DB also. Ref. Save highchart to binary image.

提交回复
热议问题