Home forums Using CanvasJS Graph doesn't scale when printing Reply To: Graph doesn't scale when printing



I have used this library for drawing in my web page. Frame containing the chart is in a div. i want to print div content. when i use this cod, in print dialog box, i see 2 diffrent page; one of them contain the table and another one contain the chart. i want to see the chart under the table in one page. ? can anyone help me?
the code is:

function printDiv(divName) {
     var printContents = document.getElementById(divName).innerHTML;
     var originalContents = document.body.innerHTML;
     var frm = document.getElementById("ifrm").contentWindow;
     document.body.innerHTML = printContents+frm;
     document.body.innerHTML = originalContents;

<div id="printableArea" >
      <ifram id="ifrm" name="ifrm" src="...">
            /*   frame content is the canvasjs chart     */
<a href="" class="btn btn-primary" onclick="printDiv('printableArea')">print</a>
  • This reply was modified 2 years, 1 month ago by  monba.