markrcote / flot-axislabels

Axis Labels Plugin for Flot. This repo is unmaintained in part due to flot being in a similar situation.
95 stars 71 forks source link

chart label doesn't look right after applying html2canvas #20

Closed user1020 closed 10 years ago

user1020 commented 10 years ago

The flot-axislabels library make the chart label look very nice. Thank you!

However, when I was using html2canvas library (a big thank-you!) to save a div to an image, it's almost what I want, but the y-axis label was not done right. See the two graphs. It could be a problem on html2canvas, just wonder there is a fix on flot-axislabels side? Appreciate your help!

Here is my code: $('#theChart').html2canvas({ onrendered: function (canvas) { z = canvas.toDataURL("image/png"); myWindow = window.open('', 'header', 'menubar=0', 'toolbar=0'); myWindow.document.write('Right click to save image
'); } });

1 2

markrcote commented 10 years ago

Hm, if it looks fine before you save it, I would say it's a bug in html2canvas. I certainly haven't seen anything garbled like that. You could try forcing the labels to be canvas instead of HTML though, by setting axisLabelUseCanvas to true (see README.md).

On 2014-03-12, 7:19 PM, user1020 wrote:

The flot-axislabels library make the chart label look very nice. Thank you!

However, when I was using html2canvas library (a big thank-you!) to save a div to an image, it's almost what I want, but the y-axis label was not done right. See the two graphs. It could be a problem on html2canvas, just wonder there is a fix on flot-axislabels side? Appreciate your help!

Here is my code: $('#theChart').html2canvas({ onrendered: function (canvas) { z = canvas.toDataURL("image/png"); myWindow = window.open('', 'header', 'menubar=0', 'toolbar=0'); myWindow.document.write('Right click to save image '); } });

1 https://f.cloud.github.com/assets/1478660/2404494/74ebfcf4-aa3c-11e3-8418-a5b21b153469.png 2 https://f.cloud.github.com/assets/1478660/2404496/78986da6-aa3c-11e3-81a9-2b7a08150451.png

— Reply to this email directly or view it on GitHub https://github.com/markrcote/flot-axislabels/issues/20.

user1020 commented 10 years ago

Thanks Mark. After I set it to be true and the created image looks fine now.

Appreciate your quick response!

markrcote commented 10 years ago

Glad that worked!