I try to save the fleet diagram for an image and end up as a pdf, but cannot figure out how to do this.
On the net, I see what I can do
canvas.toDataURL("image/png")
But the problem is how can I get the canvas first, examples say use
document.getElementById("canvas");
but for my code I use a div with id = "placeholder" (for all fleet examples), and nothing is tagged with canvas in my html, and this does not seem to work. My javascript for the fleet looks like
$.plot($("#placeholder"), [ d1, d2, d3 ], { series: { lines: { show:false }, bars: { show: true, barWidth: 0.6, horizontal:true } } });
Does anyone have a working example that displays a fleet chart, and then there is a button for saving / viewing as an image or pdf?
There are several questions that already answer this, but as far as I can tell, I miss some key details - I apologize for pushing this.
source share