Printing Options for jqPlot
I have a ASP.NET page which uses jqPlot to generate some graphs in the client at runtime (the number of graphs can vary). I would like to be able to print out just the generated graphs but I'm not sure of the best approach.
I have never really worked with preparing web pages for printing, but from what I have read there are two schools of thought:
- Use CSS to turn off all the undesirable elements using media开发者_如何学编程="print".
- Use JS to create a new window and pass into it the content to print. Presumably with jqPlot, this would mean I have to pass over all the objects required to produce the graphs and re-render the graph objects.
As the graphs are created on the client I can rule out any ASP.Net server side printing techniques. The second method above seems like overkill and would be complicated to implement. So far I'm favouring the CSS method.
Would love to hear how others have tackled similar problems.
Take a look at this, may be it'll be helpful. it's a print solution for hightChart in .net. Hope there could be something there inspirational... https://github.com/imclem/Highcharts-export-module-asp.net
精彩评论