IE 7 & 8 jqplot misalignment while printing

我怕爱的太早我们不能终老 提交于 2019-12-11 10:42:14

问题


I am having some trouble getting the graph created with jqplot to print with proper alignment in IE 7 & 8. It looks great on the screen, but once I click print preview it get's all messed up.

Help me please

Alignment in IE 9, Firefox and Chrome is perfect. Any help would be greatly appreciated


回答1:


This worked for me. It's a javascript function that resets the absolute position of each canvas.




回答2:


Added a class iterator to the canvases and then use browser hacks to perfectly alignment the bars for different browsers.

This is the modified excanvas : http://pastebin.com/mgHUbe3S

Line 309 is where the magic happens

    var el = surfaceElement.ownerDocument.createElement('div');
    **el.className = "seriesContainer_"+counter;**
    el.style.width =  surfaceElement.clientWidth + 'px';
    el.style.height = surfaceElement.clientHeight + 'px';
    el.style.overflow = 'hidden';
    el.style.position = 'absolute';
    surfaceElement.appendChild(el);

    this.element_ = el;
    this.arcScaleX_ = 1;
    this.arcScaleY_ = 1;
    this.lineScale_ = 1;
    counter++;
  }



回答3:


Go through your printing settings and make sure it is CSS enabled.



来源:https://stackoverflow.com/questions/5806492/ie-7-8-jqplot-misalignment-while-printing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!