Home Forums Chart Support Save as JPG,PNG error in Chrome

Save as JPG,PNG error in Chrome

Viewing 4 posts - 1 through 4 (of 4 total)
  • #11725

    Hi,
    Have this error when trying to save image of chart:
    -canvasjs.min.js:13 Uncaught TypeError: window.URL.createObjectURL is not a function
    using Chrome: ver 52.0.2743.116 m (64-bit)
    it works fine in IE11

    Any idea why?

    Code:
    function chart2(open, closed, arr, chartContainer, type, title, end) {

    var chart = new CanvasJS.Chart(chartContainer, {
    title: {
    text: “Total Issues”,
    },
    exportEnabled: true,
    data: [{
    click: function(e) {
    chartClick(e.dataPoint.label, type, “Open”, end)
    },
    type: “column”,
    name: “open”,
    color: “blue”,
    showInLegend: true,
    dataPoints: [

    ]
    }, {

    click: function(e) {
    chartClick(e.dataPoint.label, type, “Closed”, end)
    },
    type: “column”,
    name: “closed”,
    color: “green”,
    showInLegend: true,
    dataPoints: [

    ]
    }]
    });
    var arrLength = arr.length;
    for (i = 0; i < arrLength; i++) {
    chart.options.data[0].dataPoints.push({
    label: arr[i],
    y: open[i]
    });
    chart.options.data[1].dataPoints.push({
    label: arr[i],
    y: closed[i]
    });
    };
    chart.options.title.text = title;
    chart.render();
    };

    #11726

    Ulee,

    We are unable to reproduce the issue as the parameters passed to function are not known. Can you please create a jsfiddle with the issue, so that we can look into it and help you in resolving?

    #11727

    Hi Vishwas and thx for quick reply,
    it works like a charm in jsfidle example .. so I am not able to reproduce the issue in the jsfiddle.
    Working example: http://jsfiddle.net/Ulee/ysv8409b/1/

    more error details:
    canvasjs.min.js:13 Uncaught TypeError: window.URL.createObjectURL is not a function canvasjs.min.js:13
    za @ canvasjs.min.js:13
    (anonymous function) @ canvasjs.min.js:74

    f.href=window.URL.createObjectURL(b)}}if(!e)try{event=document.createEvent("MouseEvents"),event.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),f.dispatchEvent?f.dispatchEvent(event):f.fireEvent&amp;&amp;f.fireEvent("onclick")}catch(l){b=window.open(),b.document.write("<img src='"+a+"' />&lt;%2Fimg&gt;&lt;div&gt;Please right click on the image and save it to your device&lt;/div&gt;"),b.document.close()}}}function Q(a,b,c){b.getAttribute("state")!==c&amp;&amp;(b.setAttribute("state",c),b.setAttribute("type",

    Any idea where to start looking when it is working fine in IE but not Chrome?

    • This reply was modified 7 years, 8 months ago by Ulee.
    #11730

    ok, issue fixed.
    there was global variable set that was messing out with canvasjs code
    thx for your time

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.