当前位置:   jquery > 正文

将jqPlot图保存到图像文件

javascript,image,save,mouseclick-event,jqplot,DevBox,在线流程图,编程,编程问答,程序员,开发者工具,开发工具,json解析,二维码生成,unix时间戳,在线开发工具,前端开发工具,开发人员工具,站长工具

我正在使用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" }
                }
                ]
    }
); 

需要在上面的代码中添加什么才能将图形保存到图像文件中?



1> Liang..:

试试这个:

$('#FinancialsLineGraph').jqplotSaveImage()

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/blog/jquery/detail/13232
推荐阅读
相关标签
  

闽ICP备14008679号