How to plot Graph as a Image?

59 views
Skip to first unread message

Samadhan Kshirsagar

unread,
Mar 21, 2016, 6:53:33 AM3/21/16
to jqplot-dev
Hi all,

I have created a bar chart graph.Now I want to do this bar chart graph is in image.So I have written following code for it.But it is not working.

 createImagePlot = function(){

                //after creating your plot do

                var imgData = $('#Report').jqplotToImageStr({}); // given the div id of your plot, get the img data

                var imgElem = $('<img/>').attr('src',imgData); // create an img and add the data to it

                $('#imgChart').append(imgElem);// append the img to the DOM

                  }

and divisions are here.

<div id="Report">

<button id="imgButton" onclick="createImagePlot()">View Plot as Image</button>
  
<div id ="imgChart" ></div>


The issue is that when I am clicking button that time Graph is not showing and the page is refreshing.

please any one has any idea please share.

Thanks in Advance
Reply all
Reply to author
Forward
0 new messages