我正在使用jqPlot在某些网页上显示许多图。我希望能够将这些图表保存为图像文件。将jqPlot图保存为图像文件
这样做的最好方法是什么?是否有可能在图形上有一个右键菜单选项,使图形能够保存到图像文件中?
这里是我的图的一个部分代码:
var plotCogsLineGraph = $.jqplot('FinancialsLineGraph', [[30,31,34,40,45], [34,38,31,42,38]],
{
axes:
{
xaxis:
{
ticks: ['5','4','3','2','1']
},
yaxis:
{
label:'%',
pad: 1.05,
ticks: ['0','15','30','45','60']
}
},
width: 480, height: 270,
legend:{show:true, location: 's', placement: 'insideGrid', renderer: $.jqplot.EnhancedLegendRenderer},
seriesDefaults:
{
rendererOptions: {smooth: true}
},
series:[
{
lineWidth:1,
label:'COGS',
markerOptions: { size:1, style:'dimaond' }
},
{
lineWidth:1,
label:'Wages',
markerOptions: { size: 1, style:"dimaond" }
}
]
}
);
什么需要添加到这个上面的代码,以使图形保存为图像文件?
我得到一个错误的行保存到图片中:var divElem = $(” ) .attr('src',divGraph); – user2023359 2013-02-14 23:03:24
报价并未终止标签 – AnthonyLeGovic 2013-02-15 07:25:47
下载试试这个Download – 2013-09-17 08:47:25