Skip to content

Commit

Permalink
Merge pull request #2363 from pat-son/printWidthCutoff
Browse files Browse the repository at this point in the history
Large visualizations are resized before printing so they are not cut off
  • Loading branch information
bdonald25 committed Mar 25, 2016
2 parents 460bfd6 + 4c1643f commit f4a4356
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,9 @@ $ ->
type: "image/svg+xml"

$('#print-vis-btn').click =>
# Resize chart if it is too big to print
if (@chart.chartWidth > 700)
@chart.setSize(700, @chart.chartHeight, false)
@chart.print()
# Callback to detect when print controls have been closed
callback = ->
Expand All @@ -549,7 +552,7 @@ $ ->
$(window).resize()
setTimeout callback, 1000
# Resize again; otherwise, the vis is half-sized.
# Doesn't work withut putting it in another callback; I dont know why
# Doesn't work without putting it in another callback; I dont know why
call2 = -> $(window).resize()
setTimeout call2, 1000

Expand Down

0 comments on commit f4a4356

Please sign in to comment.