如何在jsp中单击按钮时将代码添加到jqPlot条形图另存为图像
How to add codes to jqPlot bar chart save as image on button click in jsp
我在jsp中显示了一个jqPplot条形图。现在我已经看到了一个按钮单击选项,可以将图表作为图像查看并将其保存到图像中,但我不知道如何实现这一点..我添加了按钮代码。
这是我的代码。
<script type="text/javascript">
$(document).ready(function(){
$.jqplot.config.enablePlugins = true;
var s1 = [200, 600, 700, 1000,1400];
var ticks = ['Local', 'STD', 'ISD', 'INET','Incoming'];
plot1 = $.jqplot('chart1', [s1], {
// Only animate if we're not using excanvas (not in IE 7 or IE 8)..
animate: !$.jqplot.use_excanvas,
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
pointLabels: { show: true }
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ticks
}
},
highlighter: { show: true }
});
$('#chart1').bind('jqplotDataClick',
function (ev, seriesIndex, pointIndex, data) {
$('#info1').html('series: '+seriesIndex+', point: '+pointIndex+', data: '+data);
}
);
});
</script>
</head>
<body>
<br/>
<br/>
<input type="submit" name="ViewImage" id="view" value="ViewImage">
<div name="chart1" id="chart1" value="chart1" style="height: 300px;width: 400px;left: 100px">
</body>
任何帮助将不胜感激。
提前谢谢..
不使用输入,使用按钮
和功能是:
$("#div_ID').jqplotSaveImage();
相关文章:
- 在jasmine描述函数中,自动向beforeEach和afterEach添加代码
- 如何在php echo中添加代码,使其在调用时成为弹出窗口
- 如何在不向现有JavaScript函数添加代码的情况下向该函数添加回调函数
- 添加代码以防止重复提交 JQuery 后提交不起作用
- 当我在 collapsible-set 中添加代码时,如何在 jquery Mobile 中刷新 collapsible
- 向每个函数调用添加代码的任意方法
- 动态地向 jQuery 添加代码
- 需要在重力表单wordpress插件中的表单标签中添加代码
- 我用这个添加代码做错了什么
- 使用 Javascript 在您的页面上添加代码示例
- Ace编辑器手动添加代码段
- HttpCompileException未被用户代码处理(当我在脚本中添加c#代码时)
- 以编程方式向javascript函数添加代码
- 将父窗口重定向为子窗口关闭,而不向子窗口添加代码
- 检查MySQL数据库并添加代码PHP
- 每周添加代码
- 返回$_GET["jsoncallback"]时出错,在下面添加代码javascript
- 为单击事件添加代码
- 为nodejs中的rest api链接添加代码智能
- 在javascript函数中添加代码块