素材牛VIP会员

jQuery实用的图表插件ecxcanvas.js

 所属分类:网页特效-表格

 浏览:1781次  评论:0次  更新时间:2016-10-25
牛币素材VIP可免积分下载
jQuery实用的图表插件ecxcanvas.js兼容IE6
积分说明:注册即送10牛币,每日签到可获得5牛币,成为VIP会员可永久免牛币下载!   充值积分   充值会员   更多说明»
素材描述:输入表信息后自动生成图标,还是很实用的。

详细介绍

使用方法:

引入相关文件

<link href="css/basic.css" type="text/css" rel="stylesheet" />
<link href="css/visualize.css" type="text/css" rel="stylesheet" />
<link href="css/visualize-dark.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/excanvas.js"></script>
<script type="text/javascript" src="js/visualize.jQuery.js"></script>

插件初始化、参数配置

$(function(){	
	$('table').visualize({type: 'pie', height: '250px', width: '370px'});
	$('table').visualize({type: 'bar', width: '370px'});
	$('table').visualize({type: 'area', width: '370px'});
	$('table').visualize({type: 'line', width: '370px'});
	
	$('table td')
		.click(function(){
			if( !$(this).is('.input') ){
				$(this).addClass('input')
					.html('<input type="text" value="'+ $(this).text() +'" />')
					.find('input').focus()
					.blur(function(){
						//remove td class, remove input
						$(this).parent().removeClass('input').html($(this).val() || 0);
						//update charts	
						$('.visualize').trigger('visualizeRefresh');
					});					
			}
		})
		.hover(function(){ $(this).addClass('hover'); },function(){ $(this).removeClass('hover'); });
});

HTML结构

<div class="demo">
	<a class="btndemo" href="index.html">演示一</a>
    <a class="btndemo" href="filtering.html">演示二</a>
    <a class="btndemo" href="default.html">演示三</a>
    <a class="btndemo" href="vanilla.html">演示四</a>
	<table style="width:100%;margin:40px 0 0 0;">
		<caption>2009年员工产品销售走势图</caption>
		<thead>
			<tr>
				<td></td>
				<th scope="col">food</th>
				<th scope="col">auto</th>
				<th scope="col">household</th>
				<th scope="col">furniture</th>
				<th scope="col">kitchen</th>
				<th scope="col">bath</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<th scope="row">Mary</th>
				<td>190</td>
				<td>160</td>
				<td>40</td>
				<td>120</td>
				<td>30</td>
				<td>70</td>
			</tr>
			<tr>
				<th scope="row">Tom</th>
				<td>3</td>
				<td>40</td>
				<td>30</td>
				<td>45</td>
				<td>35</td>
				<td>49</td>
			</tr>
			<tr>
				<th scope="row">Brad</th>
				<td>10</td>
				<td>180</td>
				<td>10</td>
				<td>85</td>
				<td>25</td>
				<td>79</td>
			</tr>
			<tr>
				<th scope="row">Kate</th>
				<td>40</td>
				<td>80</td>
				<td>90</td>
				<td>25</td>
				<td>15</td>
				<td>119</td>
			</tr>		
		</tbody>
	</table>
</div>

相关素材 - 表格

讨论这个素材(0)回答他人问题或分享使用心得会奖励牛币

〒_〒 居然一个评论都没有……

 文明上网,理性发言!   😉 阿里云幸运券,戳我领取
我的牛币余额:0
所需牛币:1 开始下载

牛币获取:签到、评论、充值    » 在线充值(10牛币=1元)