问题
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