How to print flot graph

后端 未结 5 727
臣服心动
臣服心动 2020-12-03 12:55

Can any body help me to find out, how to print dynamic graph as example generated by flot. I tried this one but it\'s printing whole page, but I want only graph portion.

5条回答
  •  独厮守ぢ
    2020-12-03 13:03

    This article describes how to copy the canvas to a normal img which can then easily be printed or saved as an image.

    The important part:

    img.src = canvas.toDataURL();
    

    See the great answer below from Ignacio Correia for more details.

提交回复
热议问题