Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
Saving chart as image
posted

Hello, 

Is there a way to convert chart as a image? I need this because of the requirement where I have to embed the graph as part of a report.

Thanks

  • 25665
    Offline posted

    Hello,

    Thank you for contacting Infragistics!

    After investigating this and doing some research, a method to export/save the chart to an image has been determined to be a product idea. You can suggest new product ideas for future versions (or vote for existing ones) at <www.infragistics.com/.../ideas>.

    Submitting your idea will allow you to communicate directly with our product management team, track the progress of your idea at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.

    Remember when submitting your idea to explain the context in which a feature would be used and why it is needed as well as anything that would prevent you from accomplishing this today. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it. You can also link back to this thread for additional details.

    Thank you in advance to submitting your product idea.

    As a workaround you can do this yourself by getting the canvases and saving them out yourself. Here is some example code we use to export the chart to an image in our jQuery chart, as you can see we get the container height and width then

    var expCanvas, imgElement = document.createElement("img");
    width = width || $("#" + chart.id() + "_chart_container").width();
    height = height || $("#" + chart.id() + "_chart_container").height();
    expCanvas = this._drawCanvas($("#" + chart.id() + " canvas"), width, height);
    imgElement.src = expCanvas.toDataURL("image/png");

    The _drawCanvas method gets the height and with of the canvas then loops through all the cancases to draw them