Javascript JqPlot到图像的打印不正确(延迟)
我将向您展示我的jqplot折线图 并绘制图像 我是如何看到底部的标签号被标记为他的标签的 My JQuery PlotoImage函数Javascript JqPlot到图像的打印不正确(延迟),javascript,jquery,Javascript,Jquery,我将向您展示我的jqplot折线图 并绘制图像 我是如何看到底部的标签号被标记为他的标签的 My JQuery PlotoImage函数 if (!$.jqplot.use_excanvas) { $('div.jqplot-target').each(function () { var outerDiv = $(document.createElement('div')); var header = $(document.c
if (!$.jqplot.use_excanvas) {
$('div.jqplot-target').each(function () {
var outerDiv = $(document.createElement('div'));
var header = $(document.createElement('div'));
var div = $(document.createElement('div'));
outerDiv.append(header);
outerDiv.append(div);
outerDiv.addClass('jqplot-image-container');
header.addClass('jqplot-image-container-header');
div.addClass('jqplot-image-container-content');
header.html('Right Click to Save Image As...');
var close = $(document.createElement('a'));
close.addClass('jqplot-image-container-close');
close.html('Close');
close.attr('href', '#');
close.click(function () {
$(this).parents('div.jqplot-image-container').hide(500);
return false;
})
header.append(close);
$(this).after(outerDiv);
outerDiv.hide();
outerDiv = header = div = close = null;
if (!$.jqplot._noToImageButton) {
var btn = $(document.createElement('button'));
btn.text('View Plot Image');
btn.addClass('jqplot-image-button');
btn.on('click', { chart: $(this) }, function (evt) {
var imgelem = evt.data.chart.jqplotToImageElem();
var div = $(this).nextAll('div.jqplot-image-container').first();
div.children('div.jqplot-image-container-content').empty();
div.children('div.jqplot-image-container-content').append(imgelem);
div.show(500);
div = null;
});
$(this).after(btn);
btn.after('<br />');
btn = null;
}
});
}
什么原因导致标签号延迟?已解决 尝试将CSS应用于
chart1
div(使用var plot1=$.jqplot('chart1',[arrays],options);
):
我过去也和jqplot有过矛盾,我搬到了弗洛特,我很开心。如果您无法解决这个问题,请尝试一下flot(也是一个基于jquery的绘图插件)。我太沉迷于使用jqplot了…我无法切换到其他库
div.jqplot-image-container {
display: none;
background-color: #fff;
border: 1px solid #999;
display: inline-block;
margin-top: 25px;
clear: both;
}
div.jqplot-image-container-header {
font-size: 1.0em;
font-weight: bold;
padding: 5px 15px;
background-color: #eee;
}
div.jqplot-image-container-content {
padding: 15px;
}
a.jqplot-image-container-close {
float: right;
}
<div style='align: left'>
<div id="chart1"></div>
....
</div>
#chart1
{
width: 800px;
height: 500px;
margin:0;
}