3

I have a dashboard with charts and graphs drawn with D3 (SVG), and i'm having an issue with styling @media print.

CSS work fine but charts do not scale and do not fit on page. Any suggestions?

I also used chrome's media overrider for testing. Issue is persistent, and with overrode media i have to refresh the page for charts to redraw and fit into their places.

I was thinking to catch onPrint event (e.g. onBeforePrint) and force charts to redraw before printing. Is it possible?

rinchik
  • 2,642
  • 8
  • 29
  • 46
  • have you tried to apply a transform: scale on your print css or redraw the chart with window.onbeforeprint? possibly a combination of scale and translate on the parent element – emran Oct 28 '13 at 21:27
  • Make your chart responsive to layout, then print. http://stackoverflow.com/questions/9400615/whats-the-best-way-to-make-a-d3-js-visualisation-layout-responsive – Phuoc Do Oct 29 '13 at 07:45

0 Answers0