Welcome to the Export Chart As PNG Example

In this example we will be exporting a chart generated using the php-d3-lib.

This example uses saveSvgAsPng.js to perform the actual svg conversion. More info on saveSvgAsPng.js can be found on Github @ https://github.com/exupero/saveSvgAsPng

The Chart


*These buttons run one of the below js functions onClick


            let showUri = function () {
                svgAsDataUri(d3.select('svg').node(), {}, function(uri) {
                    console.log('uri', uri);
                    document.getElementById("showUri").innerText = uri

            let saveImage = function () {
                saveSvgAsPng(d3.select('svg').node(), 'chart.png');