I open my JQplot on a modal Div window, which has a print button.
I want the print button to only print the graph.
Or possibly open a new window with a graph in it.
What do you think is the best route and how would that solution work?
I open my JQplot on a modal Div window, which has a print button.
I want the print button to only print the graph.
Or possibly open a new window with a graph in it.
What do you think is the best route and how would that solution work?
You could call something like this thats inside of an onclick
//if the print button is in parent window
$("#iframe")[0].contentWindow.window.PrintFrame();
//runs in child frame
function PrintFrame()
{
//hide everything you don't want to see besides the graph
window.focus();
window.print();
}
I would not open a new window.
Just create an anchor tag with an onClick event. Inside the event hide everything you don't want and then fire window.print(). Another way would be to create a print style sheet and hide everything you don't want to show up in the print style sheet.