Commit 05c023e0 by fsn

删除demo文件夹

parent 2fae8e2d
/**
* 初始化表格的列
*/
function initColumn(){
var columns = [
{field: 'selectItem',radio:true},
{title: 'id',field: 'userId', visible: false, align: 'center',valign: 'middle'},
{title: '姓名',field: 'userName',align: 'center',valign: 'middle'},
{title: '账号',field: 'userNo',align: 'center',valign: 'middle'},
{title: '角色',field: 'userRole',align: 'center',valign: 'middle',
formatter:function(value,row,index){
if(value == "1"){
return "超级管理员";
}else if(value == "2"){
return "管理员";
}else{
return "其他";
}
}
},
{title: '用户状态',field: 'userStatus',align: 'center',valign: 'middle',
formatter:function(value,row,index){
if(value == 1){
return "登录中";
}else if(value == 2){
return "已退出";
}else{
return "冻结";
}
}
},
{title: '创建时间',field: 'createTime',align: 'center',valign: 'middle'},
{title: '上次登录时间',field: 'loginTime',align: 'center',valign: 'middle'},
{title: '操作',field: '#',align: 'center',
formatter:function(value,row,index){
var e = '<a href="#" mce_href="#" onclick="editManagerInfo(\''+ row.userId + '\')">编辑</a> &nbsp;&nbsp;';
var f = '<a href="#" mce_href="#" onclick="freezeAccount(\''+ row.userId + '\')">停用</a> &nbsp;&nbsp;';
var unf = '<a href="#" mce_href="#" onclick="unFreezeAccount(\''+ row.userId + '\')">恢复</a> ';
return e+f+unf;
}
}];
return columns;
}
/**
* 点击编辑按钮时
* @param userId
*/
function editManagerInfo(userId){
console.log("userId=" + userId);
}
/**
* 点击添加管理员
*/
function addManager(){
parent.layer.open({
type: 2,
title: false,
closeBtn: false,
shade: [0],
area: ['340px', '215px'],
offset: 'rb', //右下角弹出
time: 2000, //2秒后自动关闭
shift: 2,
content: ['http://www.zi-han.net', 'no'], //iframe的url,no代表不显示滚动条
end: function(){ //此处用于演示
parent.layer.open({
type: 2,
title: '很多时候,我们想最大化看,比如像这个页面。',
shadeClose: true,
shade: false,
maxmin: true, //开启最大化最小化按钮
area: ['1150px', '650px'],
content: 'http://www.zi-han.net'
});
}
});
}
/**
* 冻结用户账户
* @param userId
*/
function freezeAccount(userId){
parent.layer.confirm('您确定要停用该账户吗?', {
btn: ['确定','取消'],
shade: false //不显示遮罩
}, function(){
var ajax = new $ax(Feng.ctxPath + "/sys/freeze/" + userId+"", function(data){
parent.layer.msg('停用成功', {icon: 1});
$('#managerTable').bootstrapTable('refresh');
},function(data){
parent.layer.msg('停用失败!', {icon: 2});
});
ajax.start();
});
}
/**
* 解除冻结用户账户
* @param userId
*/
function unFreezeAccount(userId){
parent.layer.confirm('您确定要恢复该账户吗?', {
btn: ['确定','取消'],
shade: false //不显示遮罩
}, function(){
var ajax = new $ax(Feng.ctxPath + "/sys/unfreeze/" + userId, function(data){
parent.layer.msg('恢复成功', {icon: 1});
$('#managerTable').bootstrapTable('refresh');
},function(data){
parent.layer.msg('恢复失败', {icon: 2});
});
ajax.start();
});
}
(function(document, window, $) {
var defaultColunms = initColumn();
// 管理员列表的表格
(function() {
$('#managerTable').bootstrapTable({
url : Feng.ctxPath + "/sys/members",
method : "post",
search : true,
selectItemName : "selectItem",
clickToSelect : true,
pagination : true,
sidePagination : "client",
showRefresh : true,
showColumns : true,
iconSize : 'outline',
toolbar : '#managerTableToolbar',
icons : {
refresh : 'glyphicon-repeat',
toggle : 'glyphicon-list-alt',
columns : 'glyphicon-list'
},
height : 620,
columns: defaultColunms
});
})();
})(document, window, jQuery);
[
{
"id": 0,
"name": "测试0",
"price": "&yen;0",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 1,
"name": "测试1",
"price": "&yen;1",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 2,
"name": "测试2",
"price": "&yen;2",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 3,
"name": "测试3",
"price": "&yen;3",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 4,
"name": "测试4",
"price": "&yen;4",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 5,
"name": "测试5",
"price": "&yen;5",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 6,
"name": "测试6",
"price": "&yen;6",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 7,
"name": "测试7",
"price": "&yen;7",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 8,
"name": "测试8",
"price": "&yen;8",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 9,
"name": "测试9",
"price": "&yen;9",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 10,
"name": "测试10",
"price": "&yen;10",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 11,
"name": "测试11",
"price": "&yen;11",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 12,
"name": "测试12",
"price": "&yen;12",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 13,
"name": "测试13",
"price": "&yen;13",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 14,
"name": "测试14",
"price": "&yen;14",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 15,
"name": "测试15",
"price": "&yen;15",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 16,
"name": "测试16",
"price": "&yen;16",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 17,
"name": "测试17",
"price": "&yen;17",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 18,
"name": "测试18",
"price": "&yen;18",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 19,
"name": "测试19",
"price": "&yen;19",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 20,
"name": "测试20",
"price": "&yen;20",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
}
]
[
{
"name": "asSelect",
"star": 777,
"license": "MIT",
"description": "A jQuery plugin to select multiple elements with checkboxes and radio:)",
"url": "<a href='https://github.com/amazingSurger/jquery-asSelect'>https://github.com/amazingSurger/jquery-asSelect</a>"
},
{
"name": "Bootstrap Table",
"star": 778,
"license": "MIT & XXX",
"description": "Bootstrap table displays data in a tabular format and offers rich support to radio, checkbox, sort, pagination and so on. ",
"url": "<a href='https://github.com/wenzhixin/bootstrap-table'>https://github.com/wenzhixin/bootstrap-table</a>"
},
{
"name": "asDatepicker",
"star": 779,
"license": "MIT",
"description": "A jQuery datepicker plugin for best .",
"url": "<a href='https://github.com/amazingSurger/jquery-asDatepicker'>https://github.com/amazingSurger/jquery-asDatepicker</a>"
},
{
"name": "asColorpicker",
"star": 780,
"license": "MIT",
"description": "A jQuery colorpicker for best .",
"url": "<a href='https://github.com/amazingSurger/jquery-asColorpicker'>https://github.com/amazingSurger/jquery-asColorpicker</a>"
}
]
$(function () {
var lineChart = echarts.init(document.getElementById("echarts-line-chart"));
var lineoption = {
title : {
text: '未来一周气温变化'
},
tooltip : {
trigger: 'axis'
},
legend: {
data:['最高气温','最低气温']
},
grid:{
x:40,
x2:40,
y2:24
},
calculable : true,
xAxis : [
{
type : 'category',
boundaryGap : false,
data : ['周一','周二','周三','周四','周五','周六','周日']
}
],
yAxis : [
{
type : 'value',
axisLabel : {
formatter: '{value} °C'
}
}
],
series : [
{
name:'最高气温',
type:'line',
data:[11, 11, 15, 13, 12, 13, 10],
markPoint : {
data : [
{type : 'max', name: '最大值'},
{type : 'min', name: '最小值'}
]
},
markLine : {
data : [
{type : 'average', name: '平均值'}
]
}
},
{
name:'最低气温',
type:'line',
data:[1, -2, 2, 5, 3, 2, 0],
markPoint : {
data : [
{name : '周最低', value : -2, xAxis: 1, yAxis: -1.5}
]
},
markLine : {
data : [
{type : 'average', name : '平均值'}
]
}
}
]
};
lineChart.setOption(lineoption);
$(window).resize(lineChart.resize);
var barChart = echarts.init(document.getElementById("echarts-bar-chart"));
var baroption = {
title : {
text: '某地区蒸发量和降水量'
},
tooltip : {
trigger: 'axis'
},
legend: {
data:['蒸发量','降水量']
},
grid:{
x:30,
x2:40,
y2:24
},
calculable : true,
xAxis : [
{
type : 'category',
data : ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']
}
],
yAxis : [
{
type : 'value'
}
],
series : [
{
name:'蒸发量',
type:'bar',
data:[2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3],
markPoint : {
data : [
{type : 'max', name: '最大值'},
{type : 'min', name: '最小值'}
]
},
markLine : {
data : [
{type : 'average', name: '平均值'}
]
}
},
{
name:'降水量',
type:'bar',
data:[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],
markPoint : {
data : [
{name : '年最高', value : 182.2, xAxis: 7, yAxis: 183, symbolSize:18},
{name : '年最低', value : 2.3, xAxis: 11, yAxis: 3}
]
},
markLine : {
data : [
{type : 'average', name : '平均值'}
]
}
}
]
};
barChart.setOption(baroption);
window.onresize = barChart.resize;
var scatterChart = echarts.init(document.getElementById("echarts-scatter-chart"));
var scatteroption = {
title : {
text: '男性女性身高体重分布',
subtext: '抽样调查来自: Heinz 2003'
},
tooltip : {
trigger: 'axis',
showDelay : 0,
axisPointer:{
type : 'cross',
lineStyle: {
type : 'dashed',
width : 1
}
}
},
legend: {
data:['女性','男性']
},
grid:{
x:45,
x2:40,
y2:24
},
xAxis : [
{
type : 'value',
scale:true,
axisLabel : {
formatter: '{value} cm'
}
}
],
yAxis : [
{
type : 'value',
scale:true,
axisLabel : {
formatter: '{value} kg'
}
}
],
series : [
{
name:'女性',
type:'scatter',
tooltip : {
trigger: 'item',
formatter : function (params) {
if (params.value.length > 1) {
return params.seriesName + ' :<br/>'
+ params.value[0] + 'cm '
+ params.value[1] + 'kg ';
}
else {
return params.seriesName + ' :<br/>'
+ params.name + ' : '
+ params.value + 'kg ';
}
}
},
data: [[161.2, 51.6], [167.5, 59.0], [159.5, 49.2], [157.0, 63.0], [155.8, 53.6],
[170.0, 59.0], [159.1, 47.6], [166.0, 69.8], [176.2, 66.8], [160.2, 75.2],
[172.5, 55.2], [170.9, 54.2], [172.9, 62.5], [153.4, 42.0], [160.0, 50.0],
[147.2, 49.8], [168.2, 49.2], [175.0, 73.2], [157.0, 47.8], [167.6, 68.8],
[159.5, 50.6], [175.0, 82.5], [166.8, 57.2], [176.5, 87.8], [170.2, 72.8],
[174.0, 54.5], [173.0, 59.8], [179.9, 67.3], [170.5, 67.8], [160.0, 47.0],
[154.4, 46.2], [162.0, 55.0], [176.5, 83.0], [160.0, 54.4], [152.0, 45.8],
[162.1, 53.6], [170.0, 73.2], [160.2, 52.1], [161.3, 67.9], [166.4, 56.6],
[168.9, 62.3], [163.8, 58.5], [167.6, 54.5], [160.0, 50.2], [161.3, 60.3],
[167.6, 58.3], [165.1, 56.2], [160.0, 50.2], [170.0, 72.9], [157.5, 59.8],
[167.6, 61.0], [160.7, 69.1], [163.2, 55.9], [152.4, 46.5], [157.5, 54.3],
[168.3, 54.8], [180.3, 60.7], [165.5, 60.0], [165.0, 62.0], [164.5, 60.3],
[156.0, 52.7], [160.0, 74.3], [163.0, 62.0], [165.7, 73.1], [161.0, 80.0],
[162.0, 54.7], [166.0, 53.2], [174.0, 75.7], [172.7, 61.1], [167.6, 55.7],
[151.1, 48.7], [164.5, 52.3], [163.5, 50.0], [152.0, 59.3], [169.0, 62.5],
[164.0, 55.7], [161.2, 54.8], [155.0, 45.9], [170.0, 70.6], [176.2, 67.2],
[170.0, 69.4], [162.5, 58.2], [170.3, 64.8], [164.1, 71.6], [169.5, 52.8],
[163.2, 59.8], [154.5, 49.0], [159.8, 50.0], [173.2, 69.2], [170.0, 55.9],
[161.4, 63.4], [169.0, 58.2], [166.2, 58.6], [159.4, 45.7], [162.5, 52.2],
[159.0, 48.6], [162.8, 57.8], [159.0, 55.6], [179.8, 66.8], [162.9, 59.4],
[161.0, 53.6], [151.1, 73.2], [168.2, 53.4], [168.9, 69.0], [173.2, 58.4],
[171.8, 56.2], [178.0, 70.6], [164.3, 59.8], [163.0, 72.0], [168.5, 65.2],
[166.8, 56.6], [172.7, 105.2], [163.5, 51.8], [169.4, 63.4], [167.8, 59.0],
[159.5, 47.6], [167.6, 63.0], [161.2, 55.2], [160.0, 45.0], [163.2, 54.0],
[162.2, 50.2], [161.3, 60.2], [149.5, 44.8], [157.5, 58.8], [163.2, 56.4],
[172.7, 62.0], [155.0, 49.2], [156.5, 67.2], [164.0, 53.8], [160.9, 54.4],
[162.8, 58.0], [167.0, 59.8], [160.0, 54.8], [160.0, 43.2], [168.9, 60.5],
[158.2, 46.4], [156.0, 64.4], [160.0, 48.8], [167.1, 62.2], [158.0, 55.5],
[167.6, 57.8], [156.0, 54.6], [162.1, 59.2], [173.4, 52.7], [159.8, 53.2],
[170.5, 64.5], [159.2, 51.8], [157.5, 56.0], [161.3, 63.6], [162.6, 63.2],
[160.0, 59.5], [168.9, 56.8], [165.1, 64.1], [162.6, 50.0], [165.1, 72.3],
[166.4, 55.0], [160.0, 55.9], [152.4, 60.4], [170.2, 69.1], [162.6, 84.5],
[170.2, 55.9], [158.8, 55.5], [172.7, 69.5], [167.6, 76.4], [162.6, 61.4],
[167.6, 65.9], [156.2, 58.6], [175.2, 66.8], [172.1, 56.6], [162.6, 58.6],
[160.0, 55.9], [165.1, 59.1], [182.9, 81.8], [166.4, 70.7], [165.1, 56.8],
[177.8, 60.0], [165.1, 58.2], [175.3, 72.7], [154.9, 54.1], [158.8, 49.1],
[172.7, 75.9], [168.9, 55.0], [161.3, 57.3], [167.6, 55.0], [165.1, 65.5],
[175.3, 65.5], [157.5, 48.6], [163.8, 58.6], [167.6, 63.6], [165.1, 55.2],
[165.1, 62.7], [168.9, 56.6], [162.6, 53.9], [164.5, 63.2], [176.5, 73.6],
[168.9, 62.0], [175.3, 63.6], [159.4, 53.2], [160.0, 53.4], [170.2, 55.0],
[162.6, 70.5], [167.6, 54.5], [162.6, 54.5], [160.7, 55.9], [160.0, 59.0],
[157.5, 63.6], [162.6, 54.5], [152.4, 47.3], [170.2, 67.7], [165.1, 80.9],
[172.7, 70.5], [165.1, 60.9], [170.2, 63.6], [170.2, 54.5], [170.2, 59.1],
[161.3, 70.5], [167.6, 52.7], [167.6, 62.7], [165.1, 86.3], [162.6, 66.4],
[152.4, 67.3], [168.9, 63.0], [170.2, 73.6], [175.2, 62.3], [175.2, 57.7],
[160.0, 55.4], [165.1, 104.1], [174.0, 55.5], [170.2, 77.3], [160.0, 80.5],
[167.6, 64.5], [167.6, 72.3], [167.6, 61.4], [154.9, 58.2], [162.6, 81.8],
[175.3, 63.6], [171.4, 53.4], [157.5, 54.5], [165.1, 53.6], [160.0, 60.0],
[174.0, 73.6], [162.6, 61.4], [174.0, 55.5], [162.6, 63.6], [161.3, 60.9],
[156.2, 60.0], [149.9, 46.8], [169.5, 57.3], [160.0, 64.1], [175.3, 63.6],
[169.5, 67.3], [160.0, 75.5], [172.7, 68.2], [162.6, 61.4], [157.5, 76.8],
[176.5, 71.8], [164.4, 55.5], [160.7, 48.6], [174.0, 66.4], [163.8, 67.3]
],
markPoint : {
data : [
{type : 'max', name: '最大值'},
{type : 'min', name: '最小值'}
]
},
markLine : {
data : [
{type : 'average', name: '平均值'}
]
}
},
{
name:'男性',
type:'scatter',
tooltip : {
trigger: 'item',
formatter : function (params) {
if (params.value.length > 1) {
return params.seriesName + ' :<br/>'
+ params.value[0] + 'cm '
+ params.value[1] + 'kg ';
}
else {
return params.seriesName + ' :<br/>'
+ params.name + ' : '
+ params.value + 'kg ';
}
}
},
data: [[174.0, 65.6], [175.3, 71.8], [193.5, 80.7], [186.5, 72.6], [187.2, 78.8],
[181.5, 74.8], [184.0, 86.4], [184.5, 78.4], [175.0, 62.0], [184.0, 81.6],
[180.0, 76.6], [177.8, 83.6], [192.0, 90.0], [176.0, 74.6], [174.0, 71.0],
[184.0, 79.6], [192.7, 93.8], [171.5, 70.0], [173.0, 72.4], [176.0, 85.9],
[176.0, 78.8], [180.5, 77.8], [172.7, 66.2], [176.0, 86.4], [173.5, 81.8],
[178.0, 89.6], [180.3, 82.8], [180.3, 76.4], [164.5, 63.2], [173.0, 60.9],
[183.5, 74.8], [175.5, 70.0], [188.0, 72.4], [189.2, 84.1], [172.8, 69.1],
[170.0, 59.5], [182.0, 67.2], [170.0, 61.3], [177.8, 68.6], [184.2, 80.1],
[186.7, 87.8], [171.4, 84.7], [172.7, 73.4], [175.3, 72.1], [180.3, 82.6],
[182.9, 88.7], [188.0, 84.1], [177.2, 94.1], [172.1, 74.9], [167.0, 59.1],
[169.5, 75.6], [174.0, 86.2], [172.7, 75.3], [182.2, 87.1], [164.1, 55.2],
[163.0, 57.0], [171.5, 61.4], [184.2, 76.8], [174.0, 86.8], [174.0, 72.2],
[177.0, 71.6], [186.0, 84.8], [167.0, 68.2], [171.8, 66.1], [182.0, 72.0],
[167.0, 64.6], [177.8, 74.8], [164.5, 70.0], [192.0, 101.6], [175.5, 63.2],
[171.2, 79.1], [181.6, 78.9], [167.4, 67.7], [181.1, 66.0], [177.0, 68.2],
[174.5, 63.9], [177.5, 72.0], [170.5, 56.8], [182.4, 74.5], [197.1, 90.9],
[180.1, 93.0], [175.5, 80.9], [180.6, 72.7], [184.4, 68.0], [175.5, 70.9],
[180.6, 72.5], [177.0, 72.5], [177.1, 83.4], [181.6, 75.5], [176.5, 73.0],
[175.0, 70.2], [174.0, 73.4], [165.1, 70.5], [177.0, 68.9], [192.0, 102.3],
[176.5, 68.4], [169.4, 65.9], [182.1, 75.7], [179.8, 84.5], [175.3, 87.7],
[184.9, 86.4], [177.3, 73.2], [167.4, 53.9], [178.1, 72.0], [168.9, 55.5],
[157.2, 58.4], [180.3, 83.2], [170.2, 72.7], [177.8, 64.1], [172.7, 72.3],
[165.1, 65.0], [186.7, 86.4], [165.1, 65.0], [174.0, 88.6], [175.3, 84.1],
[185.4, 66.8], [177.8, 75.5], [180.3, 93.2], [180.3, 82.7], [177.8, 58.0],
[177.8, 79.5], [177.8, 78.6], [177.8, 71.8], [177.8, 116.4], [163.8, 72.2],
[188.0, 83.6], [198.1, 85.5], [175.3, 90.9], [166.4, 85.9], [190.5, 89.1],
[166.4, 75.0], [177.8, 77.7], [179.7, 86.4], [172.7, 90.9], [190.5, 73.6],
[185.4, 76.4], [168.9, 69.1], [167.6, 84.5], [175.3, 64.5], [170.2, 69.1],
[190.5, 108.6], [177.8, 86.4], [190.5, 80.9], [177.8, 87.7], [184.2, 94.5],
[176.5, 80.2], [177.8, 72.0], [180.3, 71.4], [171.4, 72.7], [172.7, 84.1],
[172.7, 76.8], [177.8, 63.6], [177.8, 80.9], [182.9, 80.9], [170.2, 85.5],
[167.6, 68.6], [175.3, 67.7], [165.1, 66.4], [185.4, 102.3], [181.6, 70.5],
[172.7, 95.9], [190.5, 84.1], [179.1, 87.3], [175.3, 71.8], [170.2, 65.9],
[193.0, 95.9], [171.4, 91.4], [177.8, 81.8], [177.8, 96.8], [167.6, 69.1],
[167.6, 82.7], [180.3, 75.5], [182.9, 79.5], [176.5, 73.6], [186.7, 91.8],
[188.0, 84.1], [188.0, 85.9], [177.8, 81.8], [174.0, 82.5], [177.8, 80.5],
[171.4, 70.0], [185.4, 81.8], [185.4, 84.1], [188.0, 90.5], [188.0, 91.4],
[182.9, 89.1], [176.5, 85.0], [175.3, 69.1], [175.3, 73.6], [188.0, 80.5],
[188.0, 82.7], [175.3, 86.4], [170.5, 67.7], [179.1, 92.7], [177.8, 93.6],
[175.3, 70.9], [182.9, 75.0], [170.8, 93.2], [188.0, 93.2], [180.3, 77.7],
[177.8, 61.4], [185.4, 94.1], [168.9, 75.0], [185.4, 83.6], [180.3, 85.5],
[174.0, 73.9], [167.6, 66.8], [182.9, 87.3], [160.0, 72.3], [180.3, 88.6],
[167.6, 75.5], [186.7, 101.4], [175.3, 91.1], [175.3, 67.3], [175.9, 77.7],
[175.3, 81.8], [179.1, 75.5], [181.6, 84.5], [177.8, 76.6], [182.9, 85.0],
[177.8, 102.5], [184.2, 77.3], [179.1, 71.8], [176.5, 87.9], [188.0, 94.3],
[174.0, 70.9], [167.6, 64.5], [170.2, 77.3], [167.6, 72.3], [188.0, 87.3],
[174.0, 80.0], [176.5, 82.3], [180.3, 73.6], [167.6, 74.1], [188.0, 85.9],
[180.3, 73.2], [167.6, 76.3], [183.0, 65.9], [183.0, 90.9], [179.1, 89.1],
[170.2, 62.3], [177.8, 82.7], [179.1, 79.1], [190.5, 98.2], [177.8, 84.1],
[180.3, 83.2], [180.3, 83.2]
],
markPoint : {
data : [
{type : 'max', name: '最大值'},
{type : 'min', name: '最小值'}
]
},
markLine : {
data : [
{type : 'average', name: '平均值'}
]
}
}
]
};
scatterChart.setOption(scatteroption);
$(window).resize(scatterChart.resize);
var kChart = echarts.init(document.getElementById("echarts-k-chart"));
var koption = {
title : {
text: '2013年上半年上证指数'
},
tooltip : {
trigger: 'axis',
formatter: function (params) {
var res = params[0].seriesName + ' ' + params[0].name;
res += '<br/> 开盘 : ' + params[0].value[0] + ' 最高 : ' + params[0].value[3];
res += '<br/> 收盘 : ' + params[0].value[1] + ' 最低 : ' + params[0].value[2];
return res;
}
},
legend: {
data:['上证指数']
},
grid:{
x:40,
x2:2
},
dataZoom : {
show : true,
realtime: true,
start : 50,
end : 100
},
xAxis : [
{
type : 'category',
boundaryGap : true,
axisTick: {onGap:false},
splitLine: {show:false},
data : [
"2013/1/24", "2013/1/25", "2013/1/28", "2013/1/29", "2013/1/30",
"2013/1/31", "2013/2/1", "2013/2/4", "2013/2/5", "2013/2/6",
"2013/2/7", "2013/2/8", "2013/2/18", "2013/2/19", "2013/2/20",
"2013/2/21", "2013/2/22", "2013/2/25", "2013/2/26", "2013/2/27",
"2013/2/28", "2013/3/1", "2013/3/4", "2013/3/5", "2013/3/6",
"2013/3/7", "2013/3/8", "2013/3/11", "2013/3/12", "2013/3/13",
"2013/3/14", "2013/3/15", "2013/3/18", "2013/3/19", "2013/3/20",
"2013/3/21", "2013/3/22", "2013/3/25", "2013/3/26", "2013/3/27",
"2013/3/28", "2013/3/29", "2013/4/1", "2013/4/2", "2013/4/3",
"2013/4/8", "2013/4/9", "2013/4/10", "2013/4/11", "2013/4/12",
"2013/4/15", "2013/4/16", "2013/4/17", "2013/4/18", "2013/4/19",
"2013/4/22", "2013/4/23", "2013/4/24", "2013/4/25", "2013/4/26",
"2013/5/2", "2013/5/3", "2013/5/6", "2013/5/7", "2013/5/8",
"2013/5/9", "2013/5/10", "2013/5/13", "2013/5/14", "2013/5/15",
"2013/5/16", "2013/5/17", "2013/5/20", "2013/5/21", "2013/5/22",
"2013/5/23", "2013/5/24", "2013/5/27", "2013/5/28", "2013/5/29",
"2013/5/30", "2013/5/31", "2013/6/3", "2013/6/4", "2013/6/5",
"2013/6/6", "2013/6/7", "2013/6/13"
]
}
],
yAxis : [
{
type : 'value',
scale:true,
boundaryGap: [0.01, 0.01]
}
],
series : [
{
name:'上证指数',
type:'k',
data:[ // 开盘,收盘,最低,最高
[2320.26,2302.6,2287.3,2362.94],
[2300,2291.3,2288.26,2308.38],
[2295.35,2346.5,2295.35,2346.92],
[2347.22,2358.98,2337.35,2363.8],
[2360.75,2382.48,2347.89,2383.76],
[2383.43,2385.42,2371.23,2391.82],
[2377.41,2419.02,2369.57,2421.15],
[2425.92,2428.15,2417.58,2440.38],
[2411,2433.13,2403.3,2437.42],
[2432.68,2434.48,2427.7,2441.73],
[2430.69,2418.53,2394.22,2433.89],
[2416.62,2432.4,2414.4,2443.03],
[2441.91,2421.56,2415.43,2444.8],
[2420.26,2382.91,2373.53,2427.07],
[2383.49,2397.18,2370.61,2397.94],
[2378.82,2325.95,2309.17,2378.82],
[2322.94,2314.16,2308.76,2330.88],
[2320.62,2325.82,2315.01,2338.78],
[2313.74,2293.34,2289.89,2340.71],
[2297.77,2313.22,2292.03,2324.63],
[2322.32,2365.59,2308.92,2366.16],
[2364.54,2359.51,2330.86,2369.65],
[2332.08,2273.4,2259.25,2333.54],
[2274.81,2326.31,2270.1,2328.14],
[2333.61,2347.18,2321.6,2351.44],
[2340.44,2324.29,2304.27,2352.02],
[2326.42,2318.61,2314.59,2333.67],
[2314.68,2310.59,2296.58,2320.96],
[2309.16,2286.6,2264.83,2333.29],
[2282.17,2263.97,2253.25,2286.33],
[2255.77,2270.28,2253.31,2276.22],
[2269.31,2278.4,2250,2312.08],
[2267.29,2240.02,2239.21,2276.05],
[2244.26,2257.43,2232.02,2261.31],
[2257.74,2317.37,2257.42,2317.86],
[2318.21,2324.24,2311.6,2330.81],
[2321.4,2328.28,2314.97,2332],
[2334.74,2326.72,2319.91,2344.89],
[2318.58,2297.67,2281.12,2319.99],
[2299.38,2301.26,2289,2323.48],
[2273.55,2236.3,2232.91,2273.55],
[2238.49,2236.62,2228.81,2246.87],
[2229.46,2234.4,2227.31,2243.95],
[2234.9,2227.74,2220.44,2253.42],
[2232.69,2225.29,2217.25,2241.34],
[2196.24,2211.59,2180.67,2212.59],
[2215.47,2225.77,2215.47,2234.73],
[2224.93,2226.13,2212.56,2233.04],
[2236.98,2219.55,2217.26,2242.48],
[2218.09,2206.78,2204.44,2226.26],
[2199.91,2181.94,2177.39,2204.99],
[2169.63,2194.85,2165.78,2196.43],
[2195.03,2193.8,2178.47,2197.51],
[2181.82,2197.6,2175.44,2206.03],
[2201.12,2244.64,2200.58,2250.11],
[2236.4,2242.17,2232.26,2245.12],
[2242.62,2184.54,2182.81,2242.62],
[2187.35,2218.32,2184.11,2226.12],
[2213.19,2199.31,2191.85,2224.63],
[2203.89,2177.91,2173.86,2210.58],
[2170.78,2174.12,2161.14,2179.65],
[2179.05,2205.5,2179.05,2222.81],
[2212.5,2231.17,2212.5,2236.07],
[2227.86,2235.57,2219.44,2240.26],
[2242.39,2246.3,2235.42,2255.21],
[2246.96,2232.97,2221.38,2247.86],
[2228.82,2246.83,2225.81,2247.67],
[2247.68,2241.92,2231.36,2250.85],
[2238.9,2217.01,2205.87,2239.93],
[2217.09,2224.8,2213.58,2225.19],
[2221.34,2251.81,2210.77,2252.87],
[2249.81,2282.87,2248.41,2288.09],
[2286.33,2299.99,2281.9,2309.39],
[2297.11,2305.11,2290.12,2305.3],
[2303.75,2302.4,2292.43,2314.18],
[2293.81,2275.67,2274.1,2304.95],
[2281.45,2288.53,2270.25,2292.59],
[2286.66,2293.08,2283.94,2301.7],
[2293.4,2321.32,2281.47,2322.1],
[2323.54,2324.02,2321.17,2334.33],
[2316.25,2317.75,2310.49,2325.72],
[2320.74,2300.59,2299.37,2325.53],
[2300.21,2299.25,2294.11,2313.43],
[2297.1,2272.42,2264.76,2297.1],
[2270.71,2270.93,2260.87,2276.86],
[2264.43,2242.11,2240.07,2266.69],
[2242.26,2210.9,2205.07,2250.63],
[2190.1,2148.35,2126.22,2190.1]
]
}
]
};
kChart.setOption(koption);
$(window).resize(kChart.resize);
var pieChart = echarts.init(document.getElementById("echarts-pie-chart"));
var pieoption = {
title : {
text: '某站点用户访问来源',
subtext: '纯属虚构',
x:'center'
},
tooltip : {
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
legend: {
orient : 'vertical',
x : 'left',
data:['直接访问','邮件营销','联盟广告','视频广告','搜索引擎']
},
calculable : true,
series : [
{
name:'访问来源',
type:'pie',
radius : '55%',
center: ['50%', '60%'],
data:[
{value:335, name:'直接访问'},
{value:310, name:'邮件营销'},
{value:234, name:'联盟广告'},
{value:135, name:'视频广告'},
{value:1548, name:'搜索引擎'}
]
}
]
};
pieChart.setOption(pieoption);
$(window).resize(pieChart.resize);
var radarChart = echarts.init(document.getElementById("echarts-radar-chart"));
var radaroption = {
title : {
text: '预算 vs 开销',
subtext: '纯属虚构'
},
tooltip : {
trigger: 'axis'
},
legend: {
orient : 'vertical',
x : 'right',
y : 'bottom',
data:['预算分配','实际开销']
},
polar : [
{
indicator : [
{ text: '销售', max: 6000},
{ text: '管理', max: 16000},
{ text: '信息技术', max: 30000},
{ text: '客服', max: 38000},
{ text: '研发', max: 52000},
{ text: '市场', max: 25000}
]
}
],
calculable : true,
series : [
{
name: '预算 vs 开销',
type: 'radar',
data : [
{
value : [4300, 10000, 28000, 35000, 50000, 19000],
name : '预算分配'
},
{
value : [5000, 14000, 28000, 31000, 42000, 21000],
name : '实际开销'
}
]
}
]
};
radarChart.setOption(radaroption);
$(window).resize(radarChart.resize);
var mapChart = echarts.init(document.getElementById("echarts-map-chart"));
var mapoption = {
title : {
text: 'iphone销量',
subtext: '纯属虚构',
x:'center'
},
tooltip : {
trigger: 'item'
},
legend: {
orient: 'vertical',
x:'left',
data:['iphone3','iphone4','iphone5']
},
dataRange: {
min: 0,
max: 2500,
x: 'left',
y: 'bottom',
text:['高','低'], // 文本,默认为数值文本
calculable : true
},
toolbox: {
show: true,
orient : 'vertical',
x: 'right',
y: 'center',
feature : {
mark : {show: true},
dataView : {show: true, readOnly: false},
restore : {show: true},
saveAsImage : {show: true}
}
},
roamController: {
show: true,
x: 'right',
mapTypeControl: {
'china': true
}
},
series : [
{
name: 'iphone3',
type: 'map',
mapType: 'china',
roam: false,
itemStyle:{
normal:{label:{show:true}},
emphasis:{label:{show:true}}
},
data:[
{name: '北京',value: Math.round(Math.random()*1000)},
{name: '天津',value: Math.round(Math.random()*1000)},
{name: '上海',value: Math.round(Math.random()*1000)},
{name: '重庆',value: Math.round(Math.random()*1000)},
{name: '河北',value: Math.round(Math.random()*1000)},
{name: '河南',value: Math.round(Math.random()*1000)},
{name: '云南',value: Math.round(Math.random()*1000)},
{name: '辽宁',value: Math.round(Math.random()*1000)},
{name: '黑龙江',value: Math.round(Math.random()*1000)},
{name: '湖南',value: Math.round(Math.random()*1000)},
{name: '安徽',value: Math.round(Math.random()*1000)},
{name: '山东',value: Math.round(Math.random()*1000)},
{name: '新疆',value: Math.round(Math.random()*1000)},
{name: '江苏',value: Math.round(Math.random()*1000)},
{name: '浙江',value: Math.round(Math.random()*1000)},
{name: '江西',value: Math.round(Math.random()*1000)},
{name: '湖北',value: Math.round(Math.random()*1000)},
{name: '广西',value: Math.round(Math.random()*1000)},
{name: '甘肃',value: Math.round(Math.random()*1000)},
{name: '山西',value: Math.round(Math.random()*1000)},
{name: '内蒙古',value: Math.round(Math.random()*1000)},
{name: '陕西',value: Math.round(Math.random()*1000)},
{name: '吉林',value: Math.round(Math.random()*1000)},
{name: '福建',value: Math.round(Math.random()*1000)},
{name: '贵州',value: Math.round(Math.random()*1000)},
{name: '广东',value: Math.round(Math.random()*1000)},
{name: '青海',value: Math.round(Math.random()*1000)},
{name: '西藏',value: Math.round(Math.random()*1000)},
{name: '四川',value: Math.round(Math.random()*1000)},
{name: '宁夏',value: Math.round(Math.random()*1000)},
{name: '海南',value: Math.round(Math.random()*1000)},
{name: '台湾',value: Math.round(Math.random()*1000)},
{name: '香港',value: Math.round(Math.random()*1000)},
{name: '澳门',value: Math.round(Math.random()*1000)}
]
},
{
name: 'iphone4',
type: 'map',
mapType: 'china',
itemStyle:{
normal:{label:{show:true}},
emphasis:{label:{show:true}}
},
data:[
{name: '北京',value: Math.round(Math.random()*1000)},
{name: '天津',value: Math.round(Math.random()*1000)},
{name: '上海',value: Math.round(Math.random()*1000)},
{name: '重庆',value: Math.round(Math.random()*1000)},
{name: '河北',value: Math.round(Math.random()*1000)},
{name: '安徽',value: Math.round(Math.random()*1000)},
{name: '新疆',value: Math.round(Math.random()*1000)},
{name: '浙江',value: Math.round(Math.random()*1000)},
{name: '江西',value: Math.round(Math.random()*1000)},
{name: '山西',value: Math.round(Math.random()*1000)},
{name: '内蒙古',value: Math.round(Math.random()*1000)},
{name: '吉林',value: Math.round(Math.random()*1000)},
{name: '福建',value: Math.round(Math.random()*1000)},
{name: '广东',value: Math.round(Math.random()*1000)},
{name: '西藏',value: Math.round(Math.random()*1000)},
{name: '四川',value: Math.round(Math.random()*1000)},
{name: '宁夏',value: Math.round(Math.random()*1000)},
{name: '香港',value: Math.round(Math.random()*1000)},
{name: '澳门',value: Math.round(Math.random()*1000)}
]
},
{
name: 'iphone5',
type: 'map',
mapType: 'china',
itemStyle:{
normal:{label:{show:true}},
emphasis:{label:{show:true}}
},
data:[
{name: '北京',value: Math.round(Math.random()*1000)},
{name: '天津',value: Math.round(Math.random()*1000)},
{name: '上海',value: Math.round(Math.random()*1000)},
{name: '广东',value: Math.round(Math.random()*1000)},
{name: '台湾',value: Math.round(Math.random()*1000)},
{name: '香港',value: Math.round(Math.random()*1000)},
{name: '澳门',value: Math.round(Math.random()*1000)}
]
}
]
};
mapChart.setOption(mapoption);
$(window).resize(mapChart.resize);
var chordChart = echarts.init(document.getElementById("echarts-chord-chart"));
var chordoption = {
title : {
text: '测试数据',
subtext: 'From d3.js',
x:'right',
y:'bottom'
},
tooltip : {
trigger: 'item',
formatter: function (params) {
if (params.indicator2) { // is edge
return params.value.weight;
} else {// is node
return params.name
}
}
},
toolbox: {
show : true,
feature : {
restore : {show: true},
magicType: {show: true, type: ['force', 'chord']},
saveAsImage : {show: true}
}
},
legend: {
x: 'left',
data:['group1','group2', 'group3', 'group4']
},
series : [
{
type:'chord',
sort : 'ascending',
sortSub : 'descending',
showScale : true,
showScaleText : true,
data : [
{name : 'group1'},
{name : 'group2'},
{name : 'group3'},
{name : 'group4'}
],
itemStyle : {
normal : {
label : {
show : false
}
}
},
matrix : [
[11975, 5871, 8916, 2868],
[ 1951, 10048, 2060, 6171],
[ 8010, 16145, 8090, 8045],
[ 1013, 990, 940, 6907]
]
}
]
};
chordChart.setOption(chordoption);
$(window).resize(chordChart.resize);
var forceChart = echarts.init(document.getElementById("echarts-force-chart"));
var forceoption ={
title : {
text: '人物关系:乔布斯',
subtext: '数据来自人立方',
x:'right',
y:'bottom'
},
tooltip : {
trigger: 'item',
formatter: '{a} : {b}'
},
toolbox: {
show : true,
feature : {
restore : {show: true},
magicType: {show: true, type: ['force', 'chord']},
saveAsImage : {show: true}
}
},
legend: {
x: 'left',
data:['家人','朋友']
},
series : [
{
type:'force',
name : "人物关系",
ribbonType: false,
categories : [
{
name: '人物'
},
{
name: '家人'
},
{
name:'朋友'
}
],
itemStyle: {
normal: {
label: {
show: true,
textStyle: {
color: '#333'
}
},
nodeStyle : {
brushType : 'both',
borderColor : 'rgba(255,215,0,0.4)',
borderWidth : 1
},
linkStyle: {
type: 'curve'
}
},
emphasis: {
label: {
show: false
// textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
},
nodeStyle : {
//r: 30
},
linkStyle : {}
}
},
useWorker: false,
minRadius : 15,
maxRadius : 25,
gravity: 1.1,
scaling: 1.1,
roam: 'move',
nodes:[
{category:0, name: '乔布斯', value : 10},
{category:1, name: '丽萨-乔布斯',value : 2},
{category:1, name: '保罗-乔布斯',value : 3},
{category:1, name: '克拉拉-乔布斯',value : 3},
{category:1, name: '劳伦-鲍威尔',value : 7},
{category:2, name: '史蒂夫-沃兹尼艾克',value : 5},
{category:2, name: '奥巴马',value : 8},
{category:2, name: '比尔-盖茨',value : 9},
{category:2, name: '乔纳森-艾夫',value : 4},
{category:2, name: '蒂姆-库克',value : 4},
{category:2, name: '龙-韦恩',value : 1},
],
links : [
{source : '丽萨-乔布斯', target : '乔布斯', weight : 1, name: '女儿'},
{source : '保罗-乔布斯', target : '乔布斯', weight : 2, name: '父亲'},
{source : '克拉拉-乔布斯', target : '乔布斯', weight : 1, name: '母亲'},
{source : '劳伦-鲍威尔', target : '乔布斯', weight : 2},
{source : '史蒂夫-沃兹尼艾克', target : '乔布斯', weight : 3, name: '合伙人'},
{source : '奥巴马', target : '乔布斯', weight : 1},
{source : '比尔-盖茨', target : '乔布斯', weight : 6, name: '竞争对手'},
{source : '乔纳森-艾夫', target : '乔布斯', weight : 1, name: '爱将'},
{source : '蒂姆-库克', target : '乔布斯', weight : 1},
{source : '龙-韦恩', target : '乔布斯', weight : 1},
{source : '克拉拉-乔布斯', target : '保罗-乔布斯', weight : 1},
{source : '奥巴马', target : '保罗-乔布斯', weight : 1},
{source : '奥巴马', target : '克拉拉-乔布斯', weight : 1},
{source : '奥巴马', target : '劳伦-鲍威尔', weight : 1},
{source : '奥巴马', target : '史蒂夫-沃兹尼艾克', weight : 1},
{source : '比尔-盖茨', target : '奥巴马', weight : 6},
{source : '比尔-盖茨', target : '克拉拉-乔布斯', weight : 1},
{source : '蒂姆-库克', target : '奥巴马', weight : 1}
]
}
]
};
forceChart.setOption(forceoption);
$(window).resize(forceChart.resize);
var gaugeChart = echarts.init(document.getElementById("echarts-gauge-chart"));
var gaugeoption = {
tooltip : {
formatter: "{a} <br/>{c} {b}"
},
toolbox: {
show : true,
feature : {
mark : {show: true},
restore : {show: true},
saveAsImage : {show: true}
}
},
series : [
{
name:'速度',
type:'gauge',
min:0,
max:220,
splitNumber:11,
axisLine: { // 坐标轴线
lineStyle: { // 属性lineStyle控制线条样式
width: 10
}
},
axisTick: { // 坐标轴小标记
length :15, // 属性length控制线长
lineStyle: { // 属性lineStyle控制线条样式
color: 'auto'
}
},
splitLine: { // 分隔线
length :20, // 属性length控制线长
lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式
color: 'auto'
}
},
title : {
textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
fontWeight: 'bolder',
fontSize: 20,
fontStyle: 'italic'
}
},
detail : {
textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
fontWeight: 'bolder'
}
},
data:[{value: 40, name: 'km/h'}]
},
{
name:'转速',
type:'gauge',
center : ['25%', '55%'], // 默认全局居中
radius : '50%',
min:0,
max:7,
endAngle:45,
splitNumber:7,
axisLine: { // 坐标轴线
lineStyle: { // 属性lineStyle控制线条样式
width: 8
}
},
axisTick: { // 坐标轴小标记
length :12, // 属性length控制线长
lineStyle: { // 属性lineStyle控制线条样式
color: 'auto'
}
},
splitLine: { // 分隔线
length :20, // 属性length控制线长
lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式
color: 'auto'
}
},
pointer: {
width:5
},
title : {
offsetCenter: [0, '-30%'], // x, y,单位px
},
detail : {
textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
fontWeight: 'bolder'
}
},
data:[{value: 1.5, name: 'x1000 r/min'}]
},
{
name:'油表',
type:'gauge',
center : ['75%', '50%'], // 默认全局居中
radius : '50%',
min:0,
max:2,
startAngle:135,
endAngle:45,
splitNumber:2,
axisLine: { // 坐标轴线
lineStyle: { // 属性lineStyle控制线条样式
color: [[0.2, '#ff4500'],[0.8, '#48b'],[1, '#228b22']],
width: 8
}
},
axisTick: { // 坐标轴小标记
splitNumber:5,
length :10, // 属性length控制线长
lineStyle: { // 属性lineStyle控制线条样式
color: 'auto'
}
},
axisLabel: {
formatter:function(v){
switch (v + '') {
case '0' : return 'E';
case '1' : return 'Gas';
case '2' : return 'F';
}
}
},
splitLine: { // 分隔线
length :15, // 属性length控制线长
lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式
color: 'auto'
}
},
pointer: {
width:2
},
title : {
show: false
},
detail : {
show: false
},
data:[{value: 0.5, name: 'gas'}]
},
{
name:'水表',
type:'gauge',
center : ['75%', '50%'], // 默认全局居中
radius : '50%',
min:0,
max:2,
startAngle:315,
endAngle:225,
splitNumber:2,
axisLine: { // 坐标轴线
lineStyle: { // 属性lineStyle控制线条样式
color: [[0.2, '#ff4500'],[0.8, '#48b'],[1, '#228b22']],
width: 8
}
},
axisTick: { // 坐标轴小标记
show: false
},
axisLabel: {
formatter:function(v){
switch (v + '') {
case '0' : return 'H';
case '1' : return 'Water';
case '2' : return 'C';
}
}
},
splitLine: { // 分隔线
length :15, // 属性length控制线长
lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式
color: 'auto'
}
},
pointer: {
width:2
},
title : {
show: false
},
detail : {
show: false
},
data:[{value: 0.5, name: 'gas'}]
}
]
};
gaugeChart.setOption(gaugeoption);
$(window).resize(gaugeChart.resize);
var funnelChart = echarts.init(document.getElementById("echarts-funnel-chart"));
var funneloption = {
title : {
text: '漏斗图',
subtext: '纯属虚构'
},
tooltip : {
trigger: 'item',
formatter: "{a} <br/>{b} : {c}%"
},
legend: {
data : ['展现','点击','访问','咨询','订单']
},
calculable : true,
series : [
{
name:'漏斗图',
type:'funnel',
width: '40%',
data:[
{value:60, name:'访问'},
{value:40, name:'咨询'},
{value:20, name:'订单'},
{value:80, name:'点击'},
{value:100, name:'展现'}
]
},
{
name:'金字塔',
type:'funnel',
x : '50%',
sort : 'ascending',
itemStyle: {
normal: {
// color: 各异,
label: {
position: 'left'
}
}
},
data:[
{value:60, name:'访问'},
{value:40, name:'咨询'},
{value:20, name:'订单'},
{value:80, name:'点击'},
{value:100, name:'展现'}
]
}
]
};
funnelChart.setOption(funneloption);
$(window).resize(funnelChart.resize);
});
//Flot Bar Chart
$(function() {
var barOptions = {
series: {
bars: {
show: true,
barWidth: 0.6,
fill: true,
fillColor: {
colors: [{
opacity: 0.8
}, {
opacity: 0.8
}]
}
}
},
xaxis: {
tickDecimals: 0
},
colors: ["#1ab394"],
grid: {
color: "#999999",
hoverable: true,
clickable: true,
tickColor: "#D4D4D4",
borderWidth:0
},
legend: {
show: false
},
tooltip: true,
tooltipOpts: {
content: "x: %x, y: %y"
}
};
var barData = {
label: "bar",
data: [
[1, 34],
[2, 25],
[3, 19],
[4, 34],
[5, 32],
[6, 44]
]
};
$.plot($("#flot-bar-chart"), [barData], barOptions);
});
$(function() {
var barOptions = {
series: {
lines: {
show: true,
lineWidth: 2,
fill: true,
fillColor: {
colors: [{
opacity: 0.0
}, {
opacity: 0.0
}]
}
}
},
xaxis: {
tickDecimals: 0
},
colors: ["#1ab394"],
grid: {
color: "#999999",
hoverable: true,
clickable: true,
tickColor: "#D4D4D4",
borderWidth:0
},
legend: {
show: false
},
tooltip: true,
tooltipOpts: {
content: "x: %x, y: %y"
}
};
var barData = {
label: "bar",
data: [
[1, 34],
[2, 25],
[3, 19],
[4, 34],
[5, 32],
[6, 44]
]
};
$.plot($("#flot-line-chart"), [barData], barOptions);
});
//Flot Pie Chart
$(function() {
var data = [{
label: "数据 1",
data: 21,
color: "#d3d3d3",
}, {
label: "数据 2",
data: 3,
color: "#bababa",
}, {
label: "数据 3",
data: 15,
color: "#79d2c0",
}, {
label: "数据 4",
data: 52,
color: "#1ab394",
}];
var plotObj = $.plot($("#flot-pie-chart"), data, {
series: {
pie: {
show: true
}
},
grid: {
hoverable: true
},
tooltip: true,
tooltipOpts: {
content: "%p.0%, %s", // show percentages, rounding to 2 decimal places
shifts: {
x: 20,
y: 0
},
defaultTheme: false
}
});
});
$(function() {
var container = $("#flot-line-chart-moving");
// Determine how many data points to keep based on the placeholder's initial size;
// this gives us a nice high-res plot while avoiding more than one point per pixel.
var maximum = container.outerWidth() / 2 || 300;
//
var data = [];
function getRandomData() {
if (data.length) {
data = data.slice(1);
}
while (data.length < maximum) {
var previous = data.length ? data[data.length - 1] : 50;
var y = previous + Math.random() * 10 - 5;
data.push(y < 0 ? 0 : y > 100 ? 100 : y);
}
// zip the generated y values with the x values
var res = [];
for (var i = 0; i < data.length; ++i) {
res.push([i, data[i]])
}
return res;
}
//
series = [{
data: getRandomData(),
lines: {
fill: true
}
}];
//
var plot = $.plot(container, series, {
grid: {
color: "#999999",
tickColor: "#D4D4D4",
borderWidth:0,
minBorderMargin: 20,
labelMargin: 10,
backgroundColor: {
colors: ["#ffffff", "#ffffff"]
},
margin: {
top: 8,
bottom: 20,
left: 20
},
markings: function(axes) {
var markings = [];
var xaxis = axes.xaxis;
for (var x = Math.floor(xaxis.min); x < xaxis.max; x += xaxis.tickSize * 2) {
markings.push({
xaxis: {
from: x,
to: x + xaxis.tickSize
},
color: "#fff"
});
}
return markings;
}
},
colors: ["#1ab394"],
xaxis: {
tickFormatter: function() {
return "";
}
},
yaxis: {
min: 0,
max: 110
},
legend: {
show: true
}
});
// Update the random dataset at 25FPS for a smoothly-animating chart
setInterval(function updateRandom() {
series[0].data = getRandomData();
plot.setData(series);
plot.draw();
}, 40);
});
//Flot Multiple Axes Line Chart
$(function() {
var oilprices = [
[1167692400000, 61.05],
[1167778800000, 58.32],
[1167865200000, 57.35],
[1167951600000, 56.31],
[1168210800000, 55.55],
[1168297200000, 55.64],
[1168383600000, 54.02],
[1168470000000, 51.88],
[1168556400000, 52.99],
[1168815600000, 52.99],
[1168902000000, 51.21],
[1168988400000, 52.24],
[1169074800000, 50.48],
[1169161200000, 51.99],
[1169420400000, 51.13],
[1169506800000, 55.04],
[1169593200000, 55.37],
[1169679600000, 54.23],
[1169766000000, 55.42],
[1170025200000, 54.01],
[1170111600000, 56.97],
[1170198000000, 58.14],
[1170284400000, 58.14],
[1170370800000, 59.02],
[1170630000000, 58.74],
[1170716400000, 58.88],
[1170802800000, 57.71],
[1170889200000, 59.71],
[1170975600000, 59.89],
[1171234800000, 57.81],
[1171321200000, 59.06],
[1171407600000, 58.00],
[1171494000000, 57.99],
[1171580400000, 59.39],
[1171839600000, 59.39],
[1171926000000, 58.07],
[1172012400000, 60.07],
[1172098800000, 61.14],
[1172444400000, 61.39],
[1172530800000, 61.46],
[1172617200000, 61.79],
[1172703600000, 62.00],
[1172790000000, 60.07],
[1173135600000, 60.69],
[1173222000000, 61.82],
[1173308400000, 60.05],
[1173654000000, 58.91],
[1173740400000, 57.93],
[1173826800000, 58.16],
[1173913200000, 57.55],
[1173999600000, 57.11],
[1174258800000, 56.59],
[1174345200000, 59.61],
[1174518000000, 61.69],
[1174604400000, 62.28],
[1174860000000, 62.91],
[1174946400000, 62.93],
[1175032800000, 64.03],
[1175119200000, 66.03],
[1175205600000, 65.87],
[1175464800000, 64.64],
[1175637600000, 64.38],
[1175724000000, 64.28],
[1175810400000, 64.28],
[1176069600000, 61.51],
[1176156000000, 61.89],
[1176242400000, 62.01],
[1176328800000, 63.85],
[1176415200000, 63.63],
[1176674400000, 63.61],
[1176760800000, 63.10],
[1176847200000, 63.13],
[1176933600000, 61.83],
[1177020000000, 63.38],
[1177279200000, 64.58],
[1177452000000, 65.84],
[1177538400000, 65.06],
[1177624800000, 66.46],
[1177884000000, 64.40],
[1178056800000, 63.68],
[1178143200000, 63.19],
[1178229600000, 61.93],
[1178488800000, 61.47],
[1178575200000, 61.55],
[1178748000000, 61.81],
[1178834400000, 62.37],
[1179093600000, 62.46],
[1179180000000, 63.17],
[1179266400000, 62.55],
[1179352800000, 64.94],
[1179698400000, 66.27],
[1179784800000, 65.50],
[1179871200000, 65.77],
[1179957600000, 64.18],
[1180044000000, 65.20],
[1180389600000, 63.15],
[1180476000000, 63.49],
[1180562400000, 65.08],
[1180908000000, 66.30],
[1180994400000, 65.96],
[1181167200000, 66.93],
[1181253600000, 65.98],
[1181599200000, 65.35],
[1181685600000, 66.26],
[1181858400000, 68.00],
[1182117600000, 69.09],
[1182204000000, 69.10],
[1182290400000, 68.19],
[1182376800000, 68.19],
[1182463200000, 69.14],
[1182722400000, 68.19],
[1182808800000, 67.77],
[1182895200000, 68.97],
[1182981600000, 69.57],
[1183068000000, 70.68],
[1183327200000, 71.09],
[1183413600000, 70.92],
[1183586400000, 71.81],
[1183672800000, 72.81],
[1183932000000, 72.19],
[1184018400000, 72.56],
[1184191200000, 72.50],
[1184277600000, 74.15],
[1184623200000, 75.05],
[1184796000000, 75.92],
[1184882400000, 75.57],
[1185141600000, 74.89],
[1185228000000, 73.56],
[1185314400000, 75.57],
[1185400800000, 74.95],
[1185487200000, 76.83],
[1185832800000, 78.21],
[1185919200000, 76.53],
[1186005600000, 76.86],
[1186092000000, 76.00],
[1186437600000, 71.59],
[1186696800000, 71.47],
[1186956000000, 71.62],
[1187042400000, 71.00],
[1187301600000, 71.98],
[1187560800000, 71.12],
[1187647200000, 69.47],
[1187733600000, 69.26],
[1187820000000, 69.83],
[1187906400000, 71.09],
[1188165600000, 71.73],
[1188338400000, 73.36],
[1188511200000, 74.04],
[1188856800000, 76.30],
[1189116000000, 77.49],
[1189461600000, 78.23],
[1189548000000, 79.91],
[1189634400000, 80.09],
[1189720800000, 79.10],
[1189980000000, 80.57],
[1190066400000, 81.93],
[1190239200000, 83.32],
[1190325600000, 81.62],
[1190584800000, 80.95],
[1190671200000, 79.53],
[1190757600000, 80.30],
[1190844000000, 82.88],
[1190930400000, 81.66],
[1191189600000, 80.24],
[1191276000000, 80.05],
[1191362400000, 79.94],
[1191448800000, 81.44],
[1191535200000, 81.22],
[1191794400000, 79.02],
[1191880800000, 80.26],
[1191967200000, 80.30],
[1192053600000, 83.08],
[1192140000000, 83.69],
[1192399200000, 86.13],
[1192485600000, 87.61],
[1192572000000, 87.40],
[1192658400000, 89.47],
[1192744800000, 88.60],
[1193004000000, 87.56],
[1193090400000, 87.56],
[1193176800000, 87.10],
[1193263200000, 91.86],
[1193612400000, 93.53],
[1193698800000, 94.53],
[1193871600000, 95.93],
[1194217200000, 93.98],
[1194303600000, 96.37],
[1194476400000, 95.46],
[1194562800000, 96.32],
[1195081200000, 93.43],
[1195167600000, 95.10],
[1195426800000, 94.64],
[1195513200000, 95.10],
[1196031600000, 97.70],
[1196118000000, 94.42],
[1196204400000, 90.62],
[1196290800000, 91.01],
[1196377200000, 88.71],
[1196636400000, 88.32],
[1196809200000, 90.23],
[1196982000000, 88.28],
[1197241200000, 87.86],
[1197327600000, 90.02],
[1197414000000, 92.25],
[1197586800000, 90.63],
[1197846000000, 90.63],
[1197932400000, 90.49],
[1198018800000, 91.24],
[1198105200000, 91.06],
[1198191600000, 90.49],
[1198710000000, 96.62],
[1198796400000, 96.00],
[1199142000000, 99.62],
[1199314800000, 99.18],
[1199401200000, 95.09],
[1199660400000, 96.33],
[1199833200000, 95.67],
[1200351600000, 91.90],
[1200438000000, 90.84],
[1200524400000, 90.13],
[1200610800000, 90.57],
[1200956400000, 89.21],
[1201042800000, 86.99],
[1201129200000, 89.85],
[1201474800000, 90.99],
[1201561200000, 91.64],
[1201647600000, 92.33],
[1201734000000, 91.75],
[1202079600000, 90.02],
[1202166000000, 88.41],
[1202252400000, 87.14],
[1202338800000, 88.11],
[1202425200000, 91.77],
[1202770800000, 92.78],
[1202857200000, 93.27],
[1202943600000, 95.46],
[1203030000000, 95.46],
[1203289200000, 101.74],
[1203462000000, 98.81],
[1203894000000, 100.88],
[1204066800000, 99.64],
[1204153200000, 102.59],
[1204239600000, 101.84],
[1204498800000, 99.52],
[1204585200000, 99.52],
[1204671600000, 104.52],
[1204758000000, 105.47],
[1204844400000, 105.15],
[1205103600000, 108.75],
[1205276400000, 109.92],
[1205362800000, 110.33],
[1205449200000, 110.21],
[1205708400000, 105.68],
[1205967600000, 101.84],
[1206313200000, 100.86],
[1206399600000, 101.22],
[1206486000000, 105.90],
[1206572400000, 107.58],
[1206658800000, 105.62],
[1206914400000, 101.58],
[1207000800000, 100.98],
[1207173600000, 103.83],
[1207260000000, 106.23],
[1207605600000, 108.50],
[1207778400000, 110.11],
[1207864800000, 110.14],
[1208210400000, 113.79],
[1208296800000, 114.93],
[1208383200000, 114.86],
[1208728800000, 117.48],
[1208815200000, 118.30],
[1208988000000, 116.06],
[1209074400000, 118.52],
[1209333600000, 118.75],
[1209420000000, 113.46],
[1209592800000, 112.52],
[1210024800000, 121.84],
[1210111200000, 123.53],
[1210197600000, 123.69],
[1210543200000, 124.23],
[1210629600000, 125.80],
[1210716000000, 126.29],
[1211148000000, 127.05],
[1211320800000, 129.07],
[1211493600000, 132.19],
[1211839200000, 128.85],
[1212357600000, 127.76],
[1212703200000, 138.54],
[1212962400000, 136.80],
[1213135200000, 136.38],
[1213308000000, 134.86],
[1213653600000, 134.01],
[1213740000000, 136.68],
[1213912800000, 135.65],
[1214172000000, 134.62],
[1214258400000, 134.62],
[1214344800000, 134.62],
[1214431200000, 139.64],
[1214517600000, 140.21],
[1214776800000, 140.00],
[1214863200000, 140.97],
[1214949600000, 143.57],
[1215036000000, 145.29],
[1215381600000, 141.37],
[1215468000000, 136.04],
[1215727200000, 146.40],
[1215986400000, 145.18],
[1216072800000, 138.74],
[1216159200000, 134.60],
[1216245600000, 129.29],
[1216332000000, 130.65],
[1216677600000, 127.95],
[1216850400000, 127.95],
[1217282400000, 122.19],
[1217455200000, 124.08],
[1217541600000, 125.10],
[1217800800000, 121.41],
[1217887200000, 119.17],
[1217973600000, 118.58],
[1218060000000, 120.02],
[1218405600000, 114.45],
[1218492000000, 113.01],
[1218578400000, 116.00],
[1218751200000, 113.77],
[1219010400000, 112.87],
[1219096800000, 114.53],
[1219269600000, 114.98],
[1219356000000, 114.98],
[1219701600000, 116.27],
[1219788000000, 118.15],
[1219874400000, 115.59],
[1219960800000, 115.46],
[1220306400000, 109.71],
[1220392800000, 109.35],
[1220565600000, 106.23],
[1220824800000, 106.34]
];
var exchangerates = [
[1167606000000, 0.7580],
[1167692400000, 0.7580],
[1167778800000, 0.75470],
[1167865200000, 0.75490],
[1167951600000, 0.76130],
[1168038000000, 0.76550],
[1168124400000, 0.76930],
[1168210800000, 0.76940],
[1168297200000, 0.76880],
[1168383600000, 0.76780],
[1168470000000, 0.77080],
[1168556400000, 0.77270],
[1168642800000, 0.77490],
[1168729200000, 0.77410],
[1168815600000, 0.77410],
[1168902000000, 0.77320],
[1168988400000, 0.77270],
[1169074800000, 0.77370],
[1169161200000, 0.77240],
[1169247600000, 0.77120],
[1169334000000, 0.7720],
[1169420400000, 0.77210],
[1169506800000, 0.77170],
[1169593200000, 0.77040],
[1169679600000, 0.7690],
[1169766000000, 0.77110],
[1169852400000, 0.7740],
[1169938800000, 0.77450],
[1170025200000, 0.77450],
[1170111600000, 0.7740],
[1170198000000, 0.77160],
[1170284400000, 0.77130],
[1170370800000, 0.76780],
[1170457200000, 0.76880],
[1170543600000, 0.77180],
[1170630000000, 0.77180],
[1170716400000, 0.77280],
[1170802800000, 0.77290],
[1170889200000, 0.76980],
[1170975600000, 0.76850],
[1171062000000, 0.76810],
[1171148400000, 0.7690],
[1171234800000, 0.7690],
[1171321200000, 0.76980],
[1171407600000, 0.76990],
[1171494000000, 0.76510],
[1171580400000, 0.76130],
[1171666800000, 0.76160],
[1171753200000, 0.76140],
[1171839600000, 0.76140],
[1171926000000, 0.76070],
[1172012400000, 0.76020],
[1172098800000, 0.76110],
[1172185200000, 0.76220],
[1172271600000, 0.76150],
[1172358000000, 0.75980],
[1172444400000, 0.75980],
[1172530800000, 0.75920],
[1172617200000, 0.75730],
[1172703600000, 0.75660],
[1172790000000, 0.75670],
[1172876400000, 0.75910],
[1172962800000, 0.75820],
[1173049200000, 0.75850],
[1173135600000, 0.76130],
[1173222000000, 0.76310],
[1173308400000, 0.76150],
[1173394800000, 0.760],
[1173481200000, 0.76130],
[1173567600000, 0.76270],
[1173654000000, 0.76270],
[1173740400000, 0.76080],
[1173826800000, 0.75830],
[1173913200000, 0.75750],
[1173999600000, 0.75620],
[1174086000000, 0.7520],
[1174172400000, 0.75120],
[1174258800000, 0.75120],
[1174345200000, 0.75170],
[1174431600000, 0.7520],
[1174518000000, 0.75110],
[1174604400000, 0.7480],
[1174690800000, 0.75090],
[1174777200000, 0.75310],
[1174860000000, 0.75310],
[1174946400000, 0.75270],
[1175032800000, 0.74980],
[1175119200000, 0.74930],
[1175205600000, 0.75040],
[1175292000000, 0.750],
[1175378400000, 0.74910],
[1175464800000, 0.74910],
[1175551200000, 0.74850],
[1175637600000, 0.74840],
[1175724000000, 0.74920],
[1175810400000, 0.74710],
[1175896800000, 0.74590],
[1175983200000, 0.74770],
[1176069600000, 0.74770],
[1176156000000, 0.74830],
[1176242400000, 0.74580],
[1176328800000, 0.74480],
[1176415200000, 0.7430],
[1176501600000, 0.73990],
[1176588000000, 0.73950],
[1176674400000, 0.73950],
[1176760800000, 0.73780],
[1176847200000, 0.73820],
[1176933600000, 0.73620],
[1177020000000, 0.73550],
[1177106400000, 0.73480],
[1177192800000, 0.73610],
[1177279200000, 0.73610],
[1177365600000, 0.73650],
[1177452000000, 0.73620],
[1177538400000, 0.73310],
[1177624800000, 0.73390],
[1177711200000, 0.73440],
[1177797600000, 0.73270],
[1177884000000, 0.73270],
[1177970400000, 0.73360],
[1178056800000, 0.73330],
[1178143200000, 0.73590],
[1178229600000, 0.73590],
[1178316000000, 0.73720],
[1178402400000, 0.7360],
[1178488800000, 0.7360],
[1178575200000, 0.7350],
[1178661600000, 0.73650],
[1178748000000, 0.73840],
[1178834400000, 0.73950],
[1178920800000, 0.74130],
[1179007200000, 0.73970],
[1179093600000, 0.73960],
[1179180000000, 0.73850],
[1179266400000, 0.73780],
[1179352800000, 0.73660],
[1179439200000, 0.740],
[1179525600000, 0.74110],
[1179612000000, 0.74060],
[1179698400000, 0.74050],
[1179784800000, 0.74140],
[1179871200000, 0.74310],
[1179957600000, 0.74310],
[1180044000000, 0.74380],
[1180130400000, 0.74430],
[1180216800000, 0.74430],
[1180303200000, 0.74430],
[1180389600000, 0.74340],
[1180476000000, 0.74290],
[1180562400000, 0.74420],
[1180648800000, 0.7440],
[1180735200000, 0.74390],
[1180821600000, 0.74370],
[1180908000000, 0.74370],
[1180994400000, 0.74290],
[1181080800000, 0.74030],
[1181167200000, 0.73990],
[1181253600000, 0.74180],
[1181340000000, 0.74680],
[1181426400000, 0.7480],
[1181512800000, 0.7480],
[1181599200000, 0.7490],
[1181685600000, 0.74940],
[1181772000000, 0.75220],
[1181858400000, 0.75150],
[1181944800000, 0.75020],
[1182031200000, 0.74720],
[1182117600000, 0.74720],
[1182204000000, 0.74620],
[1182290400000, 0.74550],
[1182376800000, 0.74490],
[1182463200000, 0.74670],
[1182549600000, 0.74580],
[1182636000000, 0.74270],
[1182722400000, 0.74270],
[1182808800000, 0.7430],
[1182895200000, 0.74290],
[1182981600000, 0.7440],
[1183068000000, 0.7430],
[1183154400000, 0.74220],
[1183240800000, 0.73880],
[1183327200000, 0.73880],
[1183413600000, 0.73690],
[1183500000000, 0.73450],
[1183586400000, 0.73450],
[1183672800000, 0.73450],
[1183759200000, 0.73520],
[1183845600000, 0.73410],
[1183932000000, 0.73410],
[1184018400000, 0.7340],
[1184104800000, 0.73240],
[1184191200000, 0.72720],
[1184277600000, 0.72640],
[1184364000000, 0.72550],
[1184450400000, 0.72580],
[1184536800000, 0.72580],
[1184623200000, 0.72560],
[1184709600000, 0.72570],
[1184796000000, 0.72470],
[1184882400000, 0.72430],
[1184968800000, 0.72440],
[1185055200000, 0.72350],
[1185141600000, 0.72350],
[1185228000000, 0.72350],
[1185314400000, 0.72350],
[1185400800000, 0.72620],
[1185487200000, 0.72880],
[1185573600000, 0.73010],
[1185660000000, 0.73370],
[1185746400000, 0.73370],
[1185832800000, 0.73240],
[1185919200000, 0.72970],
[1186005600000, 0.73170],
[1186092000000, 0.73150],
[1186178400000, 0.72880],
[1186264800000, 0.72630],
[1186351200000, 0.72630],
[1186437600000, 0.72420],
[1186524000000, 0.72530],
[1186610400000, 0.72640],
[1186696800000, 0.7270],
[1186783200000, 0.73120],
[1186869600000, 0.73050],
[1186956000000, 0.73050],
[1187042400000, 0.73180],
[1187128800000, 0.73580],
[1187215200000, 0.74090],
[1187301600000, 0.74540],
[1187388000000, 0.74370],
[1187474400000, 0.74240],
[1187560800000, 0.74240],
[1187647200000, 0.74150],
[1187733600000, 0.74190],
[1187820000000, 0.74140],
[1187906400000, 0.73770],
[1187992800000, 0.73550],
[1188079200000, 0.73150],
[1188165600000, 0.73150],
[1188252000000, 0.7320],
[1188338400000, 0.73320],
[1188424800000, 0.73460],
[1188511200000, 0.73280],
[1188597600000, 0.73230],
[1188684000000, 0.7340],
[1188770400000, 0.7340],
[1188856800000, 0.73360],
[1188943200000, 0.73510],
[1189029600000, 0.73460],
[1189116000000, 0.73210],
[1189202400000, 0.72940],
[1189288800000, 0.72660],
[1189375200000, 0.72660],
[1189461600000, 0.72540],
[1189548000000, 0.72420],
[1189634400000, 0.72130],
[1189720800000, 0.71970],
[1189807200000, 0.72090],
[1189893600000, 0.7210],
[1189980000000, 0.7210],
[1190066400000, 0.7210],
[1190152800000, 0.72090],
[1190239200000, 0.71590],
[1190325600000, 0.71330],
[1190412000000, 0.71050],
[1190498400000, 0.70990],
[1190584800000, 0.70990],
[1190671200000, 0.70930],
[1190757600000, 0.70930],
[1190844000000, 0.70760],
[1190930400000, 0.7070],
[1191016800000, 0.70490],
[1191103200000, 0.70120],
[1191189600000, 0.70110],
[1191276000000, 0.70190],
[1191362400000, 0.70460],
[1191448800000, 0.70630],
[1191535200000, 0.70890],
[1191621600000, 0.70770],
[1191708000000, 0.70770],
[1191794400000, 0.70770],
[1191880800000, 0.70910],
[1191967200000, 0.71180],
[1192053600000, 0.70790],
[1192140000000, 0.70530],
[1192226400000, 0.7050],
[1192312800000, 0.70550],
[1192399200000, 0.70550],
[1192485600000, 0.70450],
[1192572000000, 0.70510],
[1192658400000, 0.70510],
[1192744800000, 0.70170],
[1192831200000, 0.70],
[1192917600000, 0.69950],
[1193004000000, 0.69940],
[1193090400000, 0.70140],
[1193176800000, 0.70360],
[1193263200000, 0.70210],
[1193349600000, 0.70020],
[1193436000000, 0.69670],
[1193522400000, 0.6950],
[1193612400000, 0.6950],
[1193698800000, 0.69390],
[1193785200000, 0.6940],
[1193871600000, 0.69220],
[1193958000000, 0.69190],
[1194044400000, 0.69140],
[1194130800000, 0.68940],
[1194217200000, 0.68910],
[1194303600000, 0.69040],
[1194390000000, 0.6890],
[1194476400000, 0.68340],
[1194562800000, 0.68230],
[1194649200000, 0.68070],
[1194735600000, 0.68150],
[1194822000000, 0.68150],
[1194908400000, 0.68470],
[1194994800000, 0.68590],
[1195081200000, 0.68220],
[1195167600000, 0.68270],
[1195254000000, 0.68370],
[1195340400000, 0.68230],
[1195426800000, 0.68220],
[1195513200000, 0.68220],
[1195599600000, 0.67920],
[1195686000000, 0.67460],
[1195772400000, 0.67350],
[1195858800000, 0.67310],
[1195945200000, 0.67420],
[1196031600000, 0.67440],
[1196118000000, 0.67390],
[1196204400000, 0.67310],
[1196290800000, 0.67610],
[1196377200000, 0.67610],
[1196463600000, 0.67850],
[1196550000000, 0.68180],
[1196636400000, 0.68360],
[1196722800000, 0.68230],
[1196809200000, 0.68050],
[1196895600000, 0.67930],
[1196982000000, 0.68490],
[1197068400000, 0.68330],
[1197154800000, 0.68250],
[1197241200000, 0.68250],
[1197327600000, 0.68160],
[1197414000000, 0.67990],
[1197500400000, 0.68130],
[1197586800000, 0.68090],
[1197673200000, 0.68680],
[1197759600000, 0.69330],
[1197846000000, 0.69330],
[1197932400000, 0.69450],
[1198018800000, 0.69440],
[1198105200000, 0.69460],
[1198191600000, 0.69640],
[1198278000000, 0.69650],
[1198364400000, 0.69560],
[1198450800000, 0.69560],
[1198537200000, 0.6950],
[1198623600000, 0.69480],
[1198710000000, 0.69280],
[1198796400000, 0.68870],
[1198882800000, 0.68240],
[1198969200000, 0.67940],
[1199055600000, 0.67940],
[1199142000000, 0.68030],
[1199228400000, 0.68550],
[1199314800000, 0.68240],
[1199401200000, 0.67910],
[1199487600000, 0.67830],
[1199574000000, 0.67850],
[1199660400000, 0.67850],
[1199746800000, 0.67970],
[1199833200000, 0.680],
[1199919600000, 0.68030],
[1200006000000, 0.68050],
[1200092400000, 0.6760],
[1200178800000, 0.6770],
[1200265200000, 0.6770],
[1200351600000, 0.67360],
[1200438000000, 0.67260],
[1200524400000, 0.67640],
[1200610800000, 0.68210],
[1200697200000, 0.68310],
[1200783600000, 0.68420],
[1200870000000, 0.68420],
[1200956400000, 0.68870],
[1201042800000, 0.69030],
[1201129200000, 0.68480],
[1201215600000, 0.68240],
[1201302000000, 0.67880],
[1201388400000, 0.68140],
[1201474800000, 0.68140],
[1201561200000, 0.67970],
[1201647600000, 0.67690],
[1201734000000, 0.67650],
[1201820400000, 0.67330],
[1201906800000, 0.67290],
[1201993200000, 0.67580],
[1202079600000, 0.67580],
[1202166000000, 0.6750],
[1202252400000, 0.6780],
[1202338800000, 0.68330],
[1202425200000, 0.68560],
[1202511600000, 0.69030],
[1202598000000, 0.68960],
[1202684400000, 0.68960],
[1202770800000, 0.68820],
[1202857200000, 0.68790],
[1202943600000, 0.68620],
[1203030000000, 0.68520],
[1203116400000, 0.68230],
[1203202800000, 0.68130],
[1203289200000, 0.68130],
[1203375600000, 0.68220],
[1203462000000, 0.68020],
[1203548400000, 0.68020],
[1203634800000, 0.67840],
[1203721200000, 0.67480],
[1203807600000, 0.67470],
[1203894000000, 0.67470],
[1203980400000, 0.67480],
[1204066800000, 0.67330],
[1204153200000, 0.6650],
[1204239600000, 0.66110],
[1204326000000, 0.65830],
[1204412400000, 0.6590],
[1204498800000, 0.6590],
[1204585200000, 0.65810],
[1204671600000, 0.65780],
[1204758000000, 0.65740],
[1204844400000, 0.65320],
[1204930800000, 0.65020],
[1205017200000, 0.65140],
[1205103600000, 0.65140],
[1205190000000, 0.65070],
[1205276400000, 0.6510],
[1205362800000, 0.64890],
[1205449200000, 0.64240],
[1205535600000, 0.64060],
[1205622000000, 0.63820],
[1205708400000, 0.63820],
[1205794800000, 0.63410],
[1205881200000, 0.63440],
[1205967600000, 0.63780],
[1206054000000, 0.64390],
[1206140400000, 0.64780],
[1206226800000, 0.64810],
[1206313200000, 0.64810],
[1206399600000, 0.64940],
[1206486000000, 0.64380],
[1206572400000, 0.63770],
[1206658800000, 0.63290],
[1206745200000, 0.63360],
[1206831600000, 0.63330],
[1206914400000, 0.63330],
[1207000800000, 0.6330],
[1207087200000, 0.63710],
[1207173600000, 0.64030],
[1207260000000, 0.63960],
[1207346400000, 0.63640],
[1207432800000, 0.63560],
[1207519200000, 0.63560],
[1207605600000, 0.63680],
[1207692000000, 0.63570],
[1207778400000, 0.63540],
[1207864800000, 0.6320],
[1207951200000, 0.63320],
[1208037600000, 0.63280],
[1208124000000, 0.63310],
[1208210400000, 0.63420],
[1208296800000, 0.63210],
[1208383200000, 0.63020],
[1208469600000, 0.62780],
[1208556000000, 0.63080],
[1208642400000, 0.63240],
[1208728800000, 0.63240],
[1208815200000, 0.63070],
[1208901600000, 0.62770],
[1208988000000, 0.62690],
[1209074400000, 0.63350],
[1209160800000, 0.63920],
[1209247200000, 0.640],
[1209333600000, 0.64010],
[1209420000000, 0.63960],
[1209506400000, 0.64070],
[1209592800000, 0.64230],
[1209679200000, 0.64290],
[1209765600000, 0.64720],
[1209852000000, 0.64850],
[1209938400000, 0.64860],
[1210024800000, 0.64670],
[1210111200000, 0.64440],
[1210197600000, 0.64670],
[1210284000000, 0.65090],
[1210370400000, 0.64780],
[1210456800000, 0.64610],
[1210543200000, 0.64610],
[1210629600000, 0.64680],
[1210716000000, 0.64490],
[1210802400000, 0.6470],
[1210888800000, 0.64610],
[1210975200000, 0.64520],
[1211061600000, 0.64220],
[1211148000000, 0.64220],
[1211234400000, 0.64250],
[1211320800000, 0.64140],
[1211407200000, 0.63660],
[1211493600000, 0.63460],
[1211580000000, 0.6350],
[1211666400000, 0.63460],
[1211752800000, 0.63460],
[1211839200000, 0.63430],
[1211925600000, 0.63460],
[1212012000000, 0.63790],
[1212098400000, 0.64160],
[1212184800000, 0.64420],
[1212271200000, 0.64310],
[1212357600000, 0.64310],
[1212444000000, 0.64350],
[1212530400000, 0.6440],
[1212616800000, 0.64730],
[1212703200000, 0.64690],
[1212789600000, 0.63860],
[1212876000000, 0.63560],
[1212962400000, 0.6340],
[1213048800000, 0.63460],
[1213135200000, 0.6430],
[1213221600000, 0.64520],
[1213308000000, 0.64670],
[1213394400000, 0.65060],
[1213480800000, 0.65040],
[1213567200000, 0.65030],
[1213653600000, 0.64810],
[1213740000000, 0.64510],
[1213826400000, 0.6450],
[1213912800000, 0.64410],
[1213999200000, 0.64140],
[1214085600000, 0.64090],
[1214172000000, 0.64090],
[1214258400000, 0.64280],
[1214344800000, 0.64310],
[1214431200000, 0.64180],
[1214517600000, 0.63710],
[1214604000000, 0.63490],
[1214690400000, 0.63330],
[1214776800000, 0.63340],
[1214863200000, 0.63380],
[1214949600000, 0.63420],
[1215036000000, 0.6320],
[1215122400000, 0.63180],
[1215208800000, 0.6370],
[1215295200000, 0.63680],
[1215381600000, 0.63680],
[1215468000000, 0.63830],
[1215554400000, 0.63710],
[1215640800000, 0.63710],
[1215727200000, 0.63550],
[1215813600000, 0.6320],
[1215900000000, 0.62770],
[1215986400000, 0.62760],
[1216072800000, 0.62910],
[1216159200000, 0.62740],
[1216245600000, 0.62930],
[1216332000000, 0.63110],
[1216418400000, 0.6310],
[1216504800000, 0.63120],
[1216591200000, 0.63120],
[1216677600000, 0.63040],
[1216764000000, 0.62940],
[1216850400000, 0.63480],
[1216936800000, 0.63780],
[1217023200000, 0.63680],
[1217109600000, 0.63680],
[1217196000000, 0.63680],
[1217282400000, 0.6360],
[1217368800000, 0.6370],
[1217455200000, 0.64180],
[1217541600000, 0.64110],
[1217628000000, 0.64350],
[1217714400000, 0.64270],
[1217800800000, 0.64270],
[1217887200000, 0.64190],
[1217973600000, 0.64460],
[1218060000000, 0.64680],
[1218146400000, 0.64870],
[1218232800000, 0.65940],
[1218319200000, 0.66660],
[1218405600000, 0.66660],
[1218492000000, 0.66780],
[1218578400000, 0.67120],
[1218664800000, 0.67050],
[1218751200000, 0.67180],
[1218837600000, 0.67840],
[1218924000000, 0.68110],
[1219010400000, 0.68110],
[1219096800000, 0.67940],
[1219183200000, 0.68040],
[1219269600000, 0.67810],
[1219356000000, 0.67560],
[1219442400000, 0.67350],
[1219528800000, 0.67630],
[1219615200000, 0.67620],
[1219701600000, 0.67770],
[1219788000000, 0.68150],
[1219874400000, 0.68020],
[1219960800000, 0.6780],
[1220047200000, 0.67960],
[1220133600000, 0.68170],
[1220220000000, 0.68170],
[1220306400000, 0.68320],
[1220392800000, 0.68770],
[1220479200000, 0.69120],
[1220565600000, 0.69140],
[1220652000000, 0.70090],
[1220738400000, 0.70120],
[1220824800000, 0.7010],
[1220911200000, 0.70050]
];
function euroFormatter(v, axis) {
return "&yen;"+v.toFixed(axis.tickDecimals);
}
function doPlot(position) {
$.plot($("#flot-line-chart-multi"), [{
data: oilprices,
label: "油价 (&yen;)"
}, {
data: exchangerates,
label: "美元/人民币汇率",
yaxis: 2
}], {
xaxes: [{
mode: 'time'
}],
yaxes: [{
min: 0
}, {
// align if we are to the right
alignTicksWithAxis: position == "right" ? 1 : null,
position: position,
tickFormatter: euroFormatter
}],
legend: {
position: 'sw'
},
colors: ["#1ab394"],
grid: {
color: "#999999",
hoverable: true,
clickable: true,
tickColor: "#D4D4D4",
borderWidth:0,
hoverable: true //IMPORTANT! this is needed for tooltip to work,
},
tooltip: true,
tooltipOpts: {
content: "%s %x 为 %y",
xDateFormat: "%y-%0m-%0d",
onHover: function(flotItem, $tooltipEl) {
// console.log(flotItem, $tooltipEl);
}
}
});
}
doPlot("right");
$("button").click(function() {
doPlot($(this).text());
});
});
$(document).ready(function () {
var $image = $(".image-crop > img")
$($image).cropper({
aspectRatio: 1.618,
preview: ".img-preview",
done: function (data) {
// 输出结果
}
});
var $inputImage = $("#inputImage");
if (window.FileReader) {
$inputImage.change(function () {
var fileReader = new FileReader(),
files = this.files,
file;
if (!files.length) {
return;
}
file = files[0];
if (/^image\/\w+$/.test(file.type)) {
fileReader.readAsDataURL(file);
fileReader.onload = function () {
$inputImage.val("");
$image.cropper("reset", true).cropper("replace", this.result);
};
} else {
showMessage("请选择图片文件");
}
});
} else {
$inputImage.addClass("hide");
}
$("#download").click(function () {
window.open($image.cropper("getDataURL"));
});
$("#zoomIn").click(function () {
$image.cropper("zoom", 0.1);
});
$("#zoomOut").click(function () {
$image.cropper("zoom", -0.1);
});
$("#rotateLeft").click(function () {
$image.cropper("rotate", 45);
});
$("#rotateRight").click(function () {
$image.cropper("rotate", -45);
});
$("#setDrag").click(function () {
$image.cropper("setDragMode", "crop");
});
$('#data_1 .input-group.date').datepicker({
todayBtn: "linked",
keyboardNavigation: false,
forceParse: false,
calendarWeeks: true,
autoclose: true
});
$('#data_2 .input-group.date').datepicker({
startView: 1,
todayBtn: "linked",
keyboardNavigation: false,
forceParse: false,
autoclose: true,
format: "yyyy-mm-dd"
});
$('#data_3 .input-group.date').datepicker({
startView: 2,
todayBtn: "linked",
keyboardNavigation: false,
forceParse: false,
autoclose: true
});
$('#data_4 .input-group.date').datepicker({
minViewMode: 1,
keyboardNavigation: false,
forceParse: false,
autoclose: true,
todayHighlight: true
});
$('#data_5 .input-daterange').datepicker({
keyboardNavigation: false,
forceParse: false,
autoclose: true
});
var elem = document.querySelector('.js-switch');
var switchery = new Switchery(elem, {
color: '#1AB394'
});
var elem_2 = document.querySelector('.js-switch_2');
var switchery_2 = new Switchery(elem_2, {
color: '#ED5565'
});
var elem_3 = document.querySelector('.js-switch_3');
var switchery_3 = new Switchery(elem_3, {
color: '#1AB394'
});
$('.i-checks').iCheck({
checkboxClass: 'icheckbox_square-green',
radioClass: 'iradio_square-green'
});
$('.colorpicker-demo1').colorpicker();
$('.colorpicker-demo2').colorpicker();
$('.colorpicker-demo3').colorpicker();
// Code for demos
function createColorpickers() {
// Api demo
var bodyStyle = $('body')[0].style;
$('#demo_apidemo').colorpicker({
color: bodyStyle.backgroundColor
}).on('changeColor', function (ev) {
bodyStyle.backgroundColor = ev.color.toHex();
});
// Horizontal mode
$('#demo_forceformat').colorpicker({
format: 'rgba', // force this format
horizontal: true
});
$('.demo-auto').colorpicker();
// Disabled / enabled triggers
$(".disable-button").click(function (e) {
e.preventDefault();
$("#demo_endis").colorpicker('disable');
});
$(".enable-button").click(function (e) {
e.preventDefault();
$("#demo_endis").colorpicker('enable');
});
}
createColorpickers();
// Create / destroy instances
$('.demo-destroy').click(function (e) {
e.preventDefault();
$('.demo').colorpicker('destroy');
$(".disable-button, .enable-button").off('click');
});
$('.demo-create').click(function (e) {
e.preventDefault();
createColorpickers();
});
var divStyle = $('.back-change')[0].style;
$('#demo_apidemo').colorpicker({
color: divStyle.backgroundColor
}).on('changeColor', function (ev) {
divStyle.backgroundColor = ev.color.toHex();
});
$('.clockpicker').clockpicker();
$( '#file-pretty input[type="file"]' ).prettyFile();
});
var config = {
'.chosen-select': {},
'.chosen-select-deselect': {
allow_single_deselect: true
},
'.chosen-select-no-single': {
disable_search_threshold: 10
},
'.chosen-select-no-results': {
no_results_text: 'Oops, nothing found!'
},
'.chosen-select-width': {
width: "95%"
}
}
for (var selector in config) {
$(selector).chosen(config[selector]);
}
$("#ionrange_1").ionRangeSlider({
min: 0,
max: 5000,
type: 'double',
prefix: "&yen;",
maxPostfix: "+",
prettify: false,
hasGrid: true
});
$("#ionrange_2").ionRangeSlider({
min: 0,
max: 10,
type: 'single',
step: 0.1,
postfix: " 克",
prettify: false,
hasGrid: true
});
$("#ionrange_3").ionRangeSlider({
min: -50,
max: 50,
from: 0,
postfix: "°",
prettify: false,
hasGrid: true
});
$("#ionrange_4").ionRangeSlider({
values: [
"一月", "二月", "三月",
"四月", "五月", "六月",
"七月", "八月", "九月",
"十月", "十一月", "十二月"
],
type: 'single',
hasGrid: true
});
$("#ionrange_5").ionRangeSlider({
min: 10000,
max: 100000,
step: 100,
postfix: " km",
from: 55000,
hideMinMax: true,
hideFromTo: false
});
$(".dial").knob();
$("#basic_slider").noUiSlider({
start: 40,
behaviour: 'tap',
connect: 'upper',
range: {
'min': 20,
'max': 80
}
});
$("#range_slider").noUiSlider({
start: [40, 60],
behaviour: 'drag',
connect: true,
range: {
'min': 20,
'max': 80
}
});
$("#drag-fixed").noUiSlider({
start: [40, 60],
behaviour: 'drag-fixed',
connect: true,
range: {
'min': 20,
'max': 80
}
});
//以下为修改jQuery Validation插件兼容Bootstrap的方法,没有直接写在插件中是为了便于插件升级
$.validator.setDefaults({
highlight: function (element) {
$(element).closest('.form-group').removeClass('has-success').addClass('has-error');
},
success: function (element) {
element.closest('.form-group').removeClass('has-error').addClass('has-success');
},
errorElement: "span",
errorPlacement: function (error, element) {
if (element.is(":radio") || element.is(":checkbox")) {
error.appendTo(element.parent().parent().parent());
} else {
error.appendTo(element.parent());
}
},
errorClass: "help-block m-b-none",
validClass: "help-block m-b-none"
});
//以下为官方示例
$().ready(function () {
// validate the comment form when it is submitted
$("#commentForm").validate();
// validate signup form on keyup and submit
var icon = "<i class='fa fa-times-circle'></i> ";
$("#signupForm").validate({
rules: {
firstname: "required",
lastname: "required",
username: {
required: true,
minlength: 2
},
password: {
required: true,
minlength: 5
},
confirm_password: {
required: true,
minlength: 5,
equalTo: "#password"
},
email: {
required: true,
email: true
},
topic: {
required: "#newsletter:checked",
minlength: 2
},
agree: "required"
},
messages: {
firstname: icon + "请输入你的姓",
lastname: icon + "请输入您的名字",
username: {
required: icon + "请输入您的用户名",
minlength: icon + "用户名必须两个字符以上"
},
password: {
required: icon + "请输入您的密码",
minlength: icon + "密码必须5个字符以上"
},
confirm_password: {
required: icon + "请再次输入密码",
minlength: icon + "密码必须5个字符以上",
equalTo: icon + "两次输入的密码不一致"
},
email: icon + "请输入您的E-mail",
agree: {
required: icon + "必须同意协议后才能注册",
element: '#agree-error'
}
}
});
// propose username by combining first- and lastname
$("#username").focus(function () {
var firstname = $("#firstname").val();
var lastname = $("#lastname").val();
if (firstname && lastname && !this.value) {
this.value = firstname + "." + lastname;
}
});
});
/*! layer demo */ ;
! function () {
var gather = {
htdy: $('html, body')
};
//一睹为快
gather.demo1 = $('#demo1');
$('#chutiyan>a').on('click', function () {
var othis = $(this),
index = othis.index();
var p = gather.demo1.children('p').eq(index);
var top = p.position().top;
gather.demo1.animate({
scrollTop: gather.demo1.scrollTop() + top
}, 0);
switch (index) {
case 0:
var icon = -1;
(function changeIcon() {
var index = parent.layer.alert('点击确认更换图标', {
icon: icon,
shadeClose: true,
title: icon === -1 ? '初体验' : 'icon:' + icon
}, changeIcon);
if (8 === ++icon) layer.close(index);
}());
break;
case 1:
var icon = 0;
(function changeIcon1() {
var index = parent.layer.alert('点击确认更换图标', {
icon: icon,
shadeClose: true,
skin: 'layer-ext-moon',
shift: 5,
title: icon === -1 ? '第三方扩展皮肤' : 'icon:' + icon
}, changeIcon1);
if (9 === ++icon) {
parent.layer.confirm('怎么样,是否很喜欢该皮肤,去下载?', {
skin: 'layer-ext-moon'
}, function (index, layero) {
layero.find('.layui-layer-btn0').attr({
href: 'http://layer.layui.com/skin.html',
target: '_blank'
});
parent.layer.close(index);
});
};
}());
break;
case 6:
parent.layer.open({
type: 1,
area: ['420px', '240px'],
skin: 'layui-layer-rim', //加上边框
content: '<div style="padding:20px;">即直接给content传入html字符<br>当内容宽高超过定义宽高,会自动出现滚动条。<br><br><br><br><br><br><br><br><br><br><br>很高兴在下面遇见你</div>'
});
break;
case 7:
parent.layer.open({
type: 1,
skin: 'layui-layer-demo',
closeBtn: false,
area: '350px',
shift: 2,
shadeClose: true,
content: '<div style="padding:20px;">即传入skin:"样式名",然后你就可以为所欲为了。<br>你怎么样给她整容都行<br><br><br>我是华丽的酱油==。</div>'
});
break;
case 8:
layer.tips('Hi,我是tips', this);
break;
case 11:
var ii = parent.layer.load(0, {
shade: false
});
setTimeout(function () {
parent.layer.close(ii)
}, 5000);
break;
case 12:
var iii = parent.layer.load(1, {
shade: [0.1, '#fff']
});
setTimeout(function () {
parent.layer.close(iii)
}, 3000);
break;
case 13:
layer.tips('我是另外一个tips,只不过我长得跟之前那位稍有些不一样。', this, {
tips: [1, '#3595CC'],
time: 4000
});
break;
case 14:
parent.layer.prompt({
title: '输入任何口令,并确认',
formType: 1
}, function (pass) {
parent.layer.prompt({
title: '随便写点啥,并确认',
formType: 2
}, function (text) {
parent.layer.msg('演示完毕!您的口令:' + pass + '<br>您最后写下了:' + text);
});
});
break;
case 15:
parent.layer.tab({
area: ['600px', '300px'],
tab: [{
title: '无题',
content: '<div style="padding:20px; line-height:30px; text-align:center">欢迎体验layer.tab<br>此时此刻不禁让人吟诗一首:<br>一入前端深似海<br>从此妹纸是浮云<br>以下省略七个字<br>。。。。。。。<br>——贤心</div>'
}, {
title: 'TAB2',
content: '<div style="padding:20px;">TAB2该说些啥</div>'
}, {
title: 'TAB3',
content: '<div style="padding:20px;">有一种坚持叫:layer</div>'
}]
});
break;
case 16:
if (gather.photoJSON) {
layer.photos({
photos: gather.photoJSON
});
} else {
$.getJSON('js/demo/photos.json?v=', function (json) {
gather.photoJSON = json;
layer.photos({
photos: json
});
});
}
break;
default:
new Function(p.text())();
break;
}
});
}();
$(function() {
Morris.Line({
element: 'morris-one-line-chart',
data: [
{ year: '2008', value: 5 },
{ year: '2009', value: 10 },
{ year: '2010', value: 8 },
{ year: '2011', value: 22 },
{ year: '2012', value: 8 },
{ year: '2014', value: 10 },
{ year: '2015', value: 5 }
],
xkey: 'year',
ykeys: ['value'],
resize: true,
lineWidth:4,
labels: ['Value'],
lineColors: ['#1ab394'],
pointSize:5,
});
Morris.Area({
element: 'morris-area-chart',
data: [{
period: '2010 Q1',
iphone: 2666,
ipad: null,
itouch: 2647
}, {
period: '2010 Q2',
iphone: 2778,
ipad: 2294,
itouch: 2441
}, {
period: '2010 Q3',
iphone: 4912,
ipad: 1969,
itouch: 2501
}, {
period: '2010 Q4',
iphone: 3767,
ipad: 3597,
itouch: 5689
}, {
period: '2011 Q1',
iphone: 6810,
ipad: 1914,
itouch: 2293
}, {
period: '2011 Q2',
iphone: 5670,
ipad: 4293,
itouch: 1881
}, {
period: '2011 Q3',
iphone: 4820,
ipad: 3795,
itouch: 1588
}, {
period: '2011 Q4',
iphone: 15073,
ipad: 5967,
itouch: 5175
}, {
period: '2012 Q1',
iphone: 10687,
ipad: 4460,
itouch: 2028
}, {
period: '2012 Q2',
iphone: 8432,
ipad: 5713,
itouch: 1791
}],
xkey: 'period',
ykeys: ['iphone', 'ipad', 'itouch'],
labels: ['iPhone', 'iPad', 'iPod Touch'],
pointSize: 2,
hideHover: 'auto',
resize: true,
lineColors: ['#87d6c6', '#54cdb4','#1ab394'],
lineWidth:2,
pointSize:1,
});
Morris.Donut({
element: 'morris-donut-chart',
data: [{
label: "A系列",
value: 12
}, {
label: "B系列",
value: 30
}, {
label: "C系列",
value: 20
}],
resize: true,
colors: ['#87d6c6', '#54cdb4','#1ab394'],
});
Morris.Bar({
element: 'morris-bar-chart',
data: [{
y: '2006',
a: 60,
b: 50
}, {
y: '2007',
a: 75,
b: 65
}, {
y: '2008',
a: 50,
b: 40
}, {
y: '2009',
a: 75,
b: 65
}, {
y: '2010',
a: 50,
b: 40
}, {
y: '2011',
a: 75,
b: 65
}, {
y: '2012',
a: 100,
b: 90
}],
xkey: 'y',
ykeys: ['a', 'b'],
labels: ['A系列', 'B系列'],
hideHover: 'auto',
resize: true,
barColors: ['#1ab394', '#cacaca'],
});
Morris.Line({
element: 'morris-line-chart',
data: [{
y: '2006',
a: 100,
b: 90
}, {
y: '2007',
a: 75,
b: 65
}, {
y: '2008',
a: 50,
b: 40
}, {
y: '2009',
a: 75,
b: 65
}, {
y: '2010',
a: 50,
b: 40
}, {
y: '2011',
a: 75,
b: 65
}, {
y: '2012',
a: 100,
b: 90
}],
xkey: 'y',
ykeys: ['a', 'b'],
labels: ['A系列', 'B系列'],
hideHover: 'auto',
resize: true,
lineColors: ['#54cdb4','#1ab394'],
});
});
$(function() {
$("span.pie").peity("pie", {
fill: ['#1ab394', '#d7d7d7', '#ffffff']
})
$(".line").peity("line",{
fill: '#1ab394',
stroke:'#169c81',
})
$(".bar").peity("bar", {
fill: ["#1ab394", "#d7d7d7"]
})
$(".bar_dashboard").peity("bar", {
fill: ["#1ab394", "#d7d7d7"],
width:100
})
var updatingChart = $(".updating-chart").peity("line", { fill: '#1ab394',stroke:'#169c81', width: 64 })
setInterval(function() {
var random = Math.round(Math.random() * 10)
var values = updatingChart.text().split(",")
values.shift()
values.push(random)
updatingChart
.text(values.join(","))
.change()
}, 1000);
});
{
"status": 1,
"msg": "",
"title": "JSON请求的相册",
"id": 8,
"start": 0,
"data": [
{
"name": "越来越喜欢观察微小的事物",
"pid": 109,
"src": "http://f8.topitme.com/8/99/b0/1100251118d0cb0998l.jpg",
"thumb": "http://f8.topitme.com/8/99/b0/1100251118d0cb0998l.jpg",
"area": [
510,
287
]
},
{
"name": "决定,意味着对与错的并存",
"pid": 110,
"src": "http://t.williamgates.net/image-9A50_54058FA3.jpg",
"thumb": "http://t.williamgates.net/image-9A50_54058FA3.jpg",
"area": [
690,
431
]
},
{
"name": "给人姐姐般温暖的的邻家女孩",
"pid": 111,
"src": "http://t.williamgates.net/image-E9BF_54058FA3.jpg",
"thumb": "http://t.williamgates.net/image-E9BF_54058FA3.jpg",
"area": [
690,
431
]
}
]
}
$(function() {
var graph = new Rickshaw.Graph( {
element: document.querySelector("#chart"),
series: [{
color: '#1ab394',
data: [
{ x: 0, y: 40 },
{ x: 1, y: 49 },
{ x: 2, y: 38 },
{ x: 3, y: 30 },
{ x: 4, y: 32 } ]
}]
});
graph.render();
var graph2 = new Rickshaw.Graph( {
element: document.querySelector("#rickshaw_multi"),
renderer: 'area',
stroke: true,
series: [ {
data: [ { x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 38 }, { x: 3, y: 20 }, { x: 4, y: 16 } ],
color: '#1ab394',
stroke: '#17997f'
}, {
data: [ { x: 0, y: 22 }, { x: 1, y: 25 }, { x: 2, y: 38 }, { x: 3, y: 44 }, { x: 4, y: 46 } ],
color: '#eeeeee',
stroke: '#d7d7d7'
} ]
} );
graph2.renderer.unstack = true;
graph2.render();
var graph3 = new Rickshaw.Graph({
element: document.querySelector("#rickshaw_line"),
renderer: 'line',
series: [ {
data: [ { x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 38 }, { x: 3, y: 30 }, { x: 4, y: 32 } ],
color: '#1ab394'
} ]
} );
graph3.render();
var graph4 = new Rickshaw.Graph({
element: document.querySelector("#rickshaw_multi_line"),
renderer: 'line',
series: [{
data: [ { x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 38 }, { x: 3, y: 30 }, { x: 4, y: 32 } ],
color: '#1ab394'
}, {
data: [ { x: 0, y: 20 }, { x: 1, y: 24 }, { x: 2, y: 19 }, { x: 3, y: 15 }, { x: 4, y: 16 } ],
color: '#d7d7d7'
}]
});
graph4.render();
var graph5 = new Rickshaw.Graph( {
element: document.querySelector("#rickshaw_bars"),
renderer: 'bar',
series: [ {
data: [ { x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 38 }, { x: 3, y: 30 }, { x: 4, y: 32 } ],
color: '#1ab394'
} ]
} );
graph5.render();
var graph6 = new Rickshaw.Graph( {
element: document.querySelector("#rickshaw_bars_stacked"),
renderer: 'bar',
series: [
{
data: [ { x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 38 }, { x: 3, y: 30 }, { x: 4, y: 32 } ],
color: '#1ab394'
}, {
data: [ { x: 0, y: 20 }, { x: 1, y: 24 }, { x: 2, y: 19 }, { x: 3, y: 15 }, { x: 4, y: 16 } ],
color: '#d7d7d7'
} ]
} );
graph6.render();
var graph7 = new Rickshaw.Graph( {
element: document.querySelector("#rickshaw_scatterplot"),
renderer: 'scatterplot',
stroke: true,
padding: { top: 0.05, left: 0.05, right: 0.05 },
series: [ {
data: [ { x: 0, y: 15 },
{ x: 1, y: 18 },
{ x: 2, y: 10 },
{ x: 3, y: 12 },
{ x: 4, y: 15 },
{ x: 5, y: 24 },
{ x: 6, y: 28 },
{ x: 7, y: 31 },
{ x: 8, y: 22 },
{ x: 9, y: 18 },
{ x: 10, y: 16 }
],
color: '#1ab394'
} ]
} );
graph7.render();
});
$(function () {
$("#sparkline1").sparkline([34, 43, 43, 35, 44, 32, 44, 52, 25], {
type: 'line',
lineColor: '#17997f',
fillColor: '#1ab394',
});
$("#sparkline2").sparkline([5, 6, 7, 2, 0, -4, -2, 4], {
type: 'bar',
barColor: '#1ab394',
negBarColor: '#c6c6c6'});
$("#sparkline3").sparkline([1, 1, 2], {
type: 'pie',
sliceColors: ['#1ab394', '#b3b3b3', '#e4f0fb']});
$("#sparkline4").sparkline([34, 43, 43, 35, 44, 32, 15, 22, 46, 33, 86, 54, 73, 53, 12, 53, 23, 65, 23, 63, 53, 42, 34, 56, 76, 15, 54, 23, 44], {
type: 'line',
lineColor: '#17997f',
fillColor: '#ffffff',
});
$("#sparkline5").sparkline([1, 1, 0, 1, -1, -1, 1, -1, 0, 0, 1, 1], {
type: 'tristate',
posBarColor: '#1ab394',
negBarColor: '#bfbfbf'});
$("#sparkline6").sparkline([4, 6, 7, 7, 4, 3, 2, 1, 4, 4, 5, 6, 3, 4, 5, 8, 7, 6, 9, 3, 2, 4, 1, 5, 6, 4, 3, 7, ], {
type: 'discrete',
lineColor: '#1ab394'});
$("#sparkline7").sparkline([52, 12, 44], {
type: 'pie',
height: '150px',
sliceColors: ['#1ab394', '#b3b3b3', '#e4f0fb']});
$("#sparkline8").sparkline([5, 6, 7, 2, 0, 4, 2, 4, 5, 7, 2, 4, 12, 14, 4, 2, 14, 12, 7], {
type: 'bar',
barWidth: 8,
height: '150px',
barColor: '#1ab394',
negBarColor: '#c6c6c6'});
$("#sparkline9").sparkline([34, 43, 43, 35, 44, 32, 15, 22, 46, 33, 86, 54, 73, 53, 12, 53, 23, 65, 23, 63, 53, 42, 34, 56, 76, 15, 54, 23, 44], {
type: 'line',
lineWidth: 1,
height: '150px',
lineColor: '#17997f',
fillColor: '#ffffff',
});
});
[{
"Tid": "1",
"First": "奔波儿灞",
"sex": "男",
"Score": "50"
}, {
"Tid": "2",
"First": "灞波儿奔",
"sex": "男",
"Score": "94"
}, {
"Tid": "3",
"First": "作家崔成浩",
"sex": "男",
"Score": "80"
}, {
"Tid": "4",
"First": "韩寒",
"sex": "男",
"Score": "67"
}, {
"Tid": "5",
"First": "郭敬明",
"sex": "男",
"Score": "100"
}, {
"Tid": "6",
"First": "马云",
"sex": "男",
"Score": "77"
}, {
"Tid": "7",
"First": "范爷",
"sex": "女",
"Score": "87"
}]
$(function () {
var defaultData = [
{
text: '父节点 1',
href: '#parent1',
tags: ['4'],
nodes: [
{
text: '子节点 1',
href: '#child1',
tags: ['2'],
nodes: [
{
text: '孙子节点 1',
href: '#grandchild1',
tags: ['0']
},
{
text: '孙子节点 2',
href: '#grandchild2',
tags: ['0']
}
]
},
{
text: '子节点 2',
href: '#child2',
tags: ['0']
}
]
},
{
text: '父节点 2',
href: '#parent2',
tags: ['0']
},
{
text: '父节点 3',
href: '#parent3',
tags: ['0']
},
{
text: '父节点 4',
href: '#parent4',
tags: ['0']
},
{
text: '父节点 5',
href: '#parent5',
tags: ['0']
}
];
var alternateData = [
{
text: '父节点 1',
tags: ['2'],
nodes: [
{
text: '子节点 1',
tags: ['3'],
nodes: [
{
text: '孙子节点 1',
tags: ['6']
},
{
text: '孙子节点 2',
tags: ['3']
}
]
},
{
text: '子节点 2',
tags: ['3']
}
]
},
{
text: '父节点 2',
tags: ['7']
},
{
text: '父节点 3',
icon: 'glyphicon glyphicon-earphone',
href: '#demo',
tags: ['11']
},
{
text: '父节点 4',
icon: 'glyphicon glyphicon-cloud-download',
href: '/demo.html',
tags: ['19'],
selected: true
},
{
text: '父节点 5',
icon: 'glyphicon glyphicon-certificate',
color: 'pink',
backColor: 'red',
href: 'http://www.tesco.com',
tags: ['available', '0']
}
];
var json = '[' +
'{' +
'"text": "父节点 1",' +
'"nodes": [' +
'{' +
'"text": "子节点 1",' +
'"nodes": [' +
'{' +
'"text": "孙子节点 1"' +
'},' +
'{' +
'"text": "孙子节点 2"' +
'}' +
']' +
'},' +
'{' +
'"text": "子节点 2"' +
'}' +
']' +
'},' +
'{' +
'"text": "父节点 2"' +
'},' +
'{' +
'"text": "父节点 3"' +
'},' +
'{' +
'"text": "父节点 4"' +
'},' +
'{' +
'"text": "父节点 5"' +
'}' +
']';
$('#treeview1').treeview({
data: defaultData
});
$('#treeview2').treeview({
levels: 1,
data: defaultData
});
$('#treeview3').treeview({
levels: 99,
data: defaultData
});
$('#treeview4').treeview({
color: "#428bca",
data: defaultData
});
$('#treeview5').treeview({
color: "#428bca",
expandIcon: 'glyphicon glyphicon-chevron-right',
collapseIcon: 'glyphicon glyphicon-chevron-down',
nodeIcon: 'glyphicon glyphicon-bookmark',
data: defaultData
});
$('#treeview6').treeview({
color: "#428bca",
expandIcon: "glyphicon glyphicon-stop",
collapseIcon: "glyphicon glyphicon-unchecked",
nodeIcon: "glyphicon glyphicon-user",
showTags: true,
data: defaultData
});
$('#treeview7').treeview({
color: "#428bca",
showBorder: false,
data: defaultData
});
$('#treeview8').treeview({
expandIcon: "glyphicon glyphicon-stop",
collapseIcon: "glyphicon glyphicon-unchecked",
nodeIcon: "glyphicon glyphicon-user",
color: "yellow",
backColor: "purple",
onhoverColor: "orange",
borderColor: "red",
showBorder: false,
showTags: true,
highlightSelected: true,
selectedColor: "yellow",
selectedBackColor: "darkorange",
data: defaultData
});
$('#treeview9').treeview({
expandIcon: "glyphicon glyphicon-stop",
collapseIcon: "glyphicon glyphicon-unchecked",
nodeIcon: "glyphicon glyphicon-user",
color: "yellow",
backColor: "purple",
onhoverColor: "orange",
borderColor: "red",
showBorder: false,
showTags: true,
highlightSelected: true,
selectedColor: "yellow",
selectedBackColor: "darkorange",
data: alternateData
});
$('#treeview10').treeview({
color: "#428bca",
enableLinks: true,
data: defaultData
});
$('#treeview11').treeview({
color: "#428bca",
data: defaultData,
onNodeSelected: function (event, node) {
$('#event_output').prepend('<p>您单击了 ' + node.text + '</p>');
}
});
// $('#treeview11').on('nodeSelected', function (event, node) {
// $('#event_output').prepend('<p>您单击了 ' + node.text + '</p>');
// });
$('#treeview12').treeview({
data: json
});
});
jQuery(function() {
var $ = jQuery, // just in case. Make sure it's not an other libaray.
$wrap = $('#uploader'),
// 图片容器
$queue = $('<ul class="filelist"></ul>')
.appendTo( $wrap.find('.queueList') ),
// 状态栏,包括进度和控制按钮
$statusBar = $wrap.find('.statusBar'),
// 文件总体选择信息。
$info = $statusBar.find('.info'),
// 上传按钮
$upload = $wrap.find('.uploadBtn'),
// 没选择文件之前的内容。
$placeHolder = $wrap.find('.placeholder'),
// 总体进度条
$progress = $statusBar.find('.progress').hide(),
// 添加的文件数量
fileCount = 0,
// 添加的文件总大小
fileSize = 0,
// 优化retina, 在retina下这个值是2
ratio = window.devicePixelRatio || 1,
// 缩略图大小
thumbnailWidth = 110 * ratio,
thumbnailHeight = 110 * ratio,
// 可能有pedding, ready, uploading, confirm, done.
state = 'pedding',
// 所有文件的进度信息,key为file id
percentages = {},
supportTransition = (function(){
var s = document.createElement('p').style,
r = 'transition' in s ||
'WebkitTransition' in s ||
'MozTransition' in s ||
'msTransition' in s ||
'OTransition' in s;
s = null;
return r;
})(),
// WebUploader实例
uploader;
if ( !WebUploader.Uploader.support() ) {
alert( 'Web Uploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器');
throw new Error( 'WebUploader does not support the browser you are using.' );
}
// 实例化
uploader = WebUploader.create({
pick: {
multiple: false,//只上传一个
id: '#filePicker',
label: '点击选择图片'
},
dnd: '#uploader .queueList',
paste: document.body,
accept: {
title: 'Images',
extensions: 'gif,jpg,jpeg,bmp,png',
mimeTypes: 'image/*'
},
// swf文件路径
swf: BASE_URL + '/Uploader.swf',
disableGlobalDnd: true,
chunked: true,
// server: 'http://webuploader.duapp.com/server/fileupload.php',
server: 'http://2betop.net/fileupload.php',
fileNumLimit: 300,
fileSizeLimit: 5 * 1024 * 1024, // 200 M
fileSingleSizeLimit: 1 * 1024 * 1024 // 50 M
});
// 添加“添加文件”的按钮,
uploader.addButton({
id: '#filePicker2',
label: '继续添加'
});
// 当有文件添加进来时执行,负责view的创建
function addFile( file ) {
var $li = $( '<li id="' + file.id + '">' +
'<p class="title">' + file.name + '</p>' +
'<p class="imgWrap"></p>'+
'<p class="progress"><span></span></p>' +
'</li>' ),
$btns = $('<div class="file-panel">' +
'<span class="cancel">删除</span>' +
'<span class="rotateRight">向右旋转</span>' +
'<span class="rotateLeft">向左旋转</span></div>').appendTo( $li ),
$prgress = $li.find('p.progress span'),
$wrap = $li.find( 'p.imgWrap' ),
$info = $('<p class="error"></p>'),
showError = function( code ) {
switch( code ) {
case 'exceed_size':
text = '文件大小超出';
break;
case 'interrupt':
text = '上传暂停';
break;
default:
text = '上传失败,请重试';
break;
}
$info.text( text ).appendTo( $li );
};
if ( file.getStatus() === 'invalid' ) {
showError( file.statusText );
} else {
// @todo lazyload
$wrap.text( '预览中' );
uploader.makeThumb( file, function( error, src ) {
if ( error ) {
$wrap.text( '不能预览' );
return;
}
var img = $('<img src="'+src+'">');
$wrap.empty().append( img );
}, thumbnailWidth, thumbnailHeight );
percentages[ file.id ] = [ file.size, 0 ];
file.rotation = 0;
}
file.on('statuschange', function( cur, prev ) {
if ( prev === 'progress' ) {
$prgress.hide().width(0);
} else if ( prev === 'queued' ) {
$li.off( 'mouseenter mouseleave' );
$btns.remove();
}
// 成功
if ( cur === 'error' || cur === 'invalid' ) {
console.log( file.statusText );
showError( file.statusText );
percentages[ file.id ][ 1 ] = 1;
} else if ( cur === 'interrupt' ) {
showError( 'interrupt' );
} else if ( cur === 'queued' ) {
percentages[ file.id ][ 1 ] = 0;
} else if ( cur === 'progress' ) {
$info.remove();
$prgress.css('display', 'block');
} else if ( cur === 'complete' ) {
$li.append( '<span class="success"></span>' );
}
$li.removeClass( 'state-' + prev ).addClass( 'state-' + cur );
});
$li.on( 'mouseenter', function() {
$btns.stop().animate({height: 30});
});
$li.on( 'mouseleave', function() {
$btns.stop().animate({height: 0});
});
$btns.on( 'click', 'span', function() {
var index = $(this).index(),
deg;
switch ( index ) {
case 0:
uploader.removeFile( file );
return;
case 1:
file.rotation += 90;
break;
case 2:
file.rotation -= 90;
break;
}
if ( supportTransition ) {
deg = 'rotate(' + file.rotation + 'deg)';
$wrap.css({
'-webkit-transform': deg,
'-mos-transform': deg,
'-o-transform': deg,
'transform': deg
});
} else {
$wrap.css( 'filter', 'progid:DXImageTransform.Microsoft.BasicImage(rotation='+ (~~((file.rotation/90)%4 + 4)%4) +')');
// use jquery animate to rotation
// $({
// rotation: rotation
// }).animate({
// rotation: file.rotation
// }, {
// easing: 'linear',
// step: function( now ) {
// now = now * Math.PI / 180;
// var cos = Math.cos( now ),
// sin = Math.sin( now );
// $wrap.css( 'filter', "progid:DXImageTransform.Microsoft.Matrix(M11=" + cos + ",M12=" + (-sin) + ",M21=" + sin + ",M22=" + cos + ",SizingMethod='auto expand')");
// }
// });
}
});
$li.appendTo( $queue );
}
// 负责view的销毁
function removeFile( file ) {
var $li = $('#'+file.id);
delete percentages[ file.id ];
updateTotalProgress();
$li.off().find('.file-panel').off().end().remove();
}
function updateTotalProgress() {
var loaded = 0,
total = 0,
spans = $progress.children(),
percent;
$.each( percentages, function( k, v ) {
total += v[ 0 ];
loaded += v[ 0 ] * v[ 1 ];
} );
percent = total ? loaded / total : 0;
spans.eq( 0 ).text( Math.round( percent * 100 ) + '%' );
spans.eq( 1 ).css( 'width', Math.round( percent * 100 ) + '%' );
updateStatus();
}
function updateStatus() {
var text = '', stats;
if ( state === 'ready' ) {
text = '选中' + fileCount + '张图片,共' +
WebUploader.formatSize( fileSize ) + '。';
} else if ( state === 'confirm' ) {
stats = uploader.getStats();
if ( stats.uploadFailNum ) {
text = '已成功上传' + stats.successNum+ '张照片至XX相册,'+
stats.uploadFailNum + '张照片上传失败,<a class="retry" href="#">重新上传</a>失败图片或<a class="ignore" href="#">忽略</a>'
}
} else {
stats = uploader.getStats();
text = '共' + fileCount + '张(' +
WebUploader.formatSize( fileSize ) +
'),已上传' + stats.successNum + '张';
if ( stats.uploadFailNum ) {
text += ',失败' + stats.uploadFailNum + '张';
}
}
$info.html( text );
}
function setState( val ) {
var file, stats;
if ( val === state ) {
return;
}
$upload.removeClass( 'state-' + state );
$upload.addClass( 'state-' + val );
state = val;
switch ( state ) {
case 'pedding':
$placeHolder.removeClass( 'element-invisible' );
$queue.parent().removeClass('filled');
$queue.hide();
$statusBar.addClass( 'element-invisible' );
uploader.refresh();
break;
case 'ready':
$placeHolder.addClass( 'element-invisible' );
$( '#filePicker2' ).removeClass( 'element-invisible');
$queue.parent().addClass('filled');
$queue.show();
$statusBar.removeClass('element-invisible');
uploader.refresh();
break;
case 'uploading':
$( '#filePicker2' ).addClass( 'element-invisible' );
$progress.show();
$upload.text( '暂停上传' );
break;
case 'paused':
$progress.show();
$upload.text( '继续上传' );
break;
case 'confirm':
$progress.hide();
$upload.text( '开始上传' ).addClass( 'disabled' );
stats = uploader.getStats();
if ( stats.successNum && !stats.uploadFailNum ) {
setState( 'finish' );
return;
}
break;
case 'finish':
stats = uploader.getStats();
if ( stats.successNum ) {
alert( '上传成功' );
} else {
// 没有成功的图片,重设
state = 'done';
location.reload();
}
break;
}
updateStatus();
}
uploader.onUploadProgress = function( file, percentage ) {
var $li = $('#'+file.id),
$percent = $li.find('.progress span');
$percent.css( 'width', percentage * 100 + '%' );
percentages[ file.id ][ 1 ] = percentage;
updateTotalProgress();
};
uploader.onFileQueued = function( file ) {
fileCount++;
fileSize += file.size;
if ( fileCount === 1 ) {
$placeHolder.addClass( 'element-invisible' );
$statusBar.show();
}
addFile( file );
setState( 'ready' );
updateTotalProgress();
};
uploader.onFileDequeued = function( file ) {
fileCount--;
fileSize -= file.size;
if ( !fileCount ) {
setState( 'pedding' );
}
removeFile( file );
updateTotalProgress();
};
uploader.on( 'all', function( type ) {
var stats;
switch( type ) {
case 'uploadFinished':
setState( 'confirm' );
break;
case 'startUpload':
setState( 'uploading' );
break;
case 'stopUpload':
setState( 'paused' );
break;
}
});
uploader.onError = function( code ) {
alert( 'Eroor: ' + code );
};
$upload.on('click', function() {
if ( $(this).hasClass( 'disabled' ) ) {
return false;
}
if ( state === 'ready' ) {
uploader.upload();
} else if ( state === 'paused' ) {
uploader.upload();
} else if ( state === 'uploading' ) {
uploader.stop();
}
});
$info.on( 'click', '.retry', function() {
uploader.retry();
} );
$info.on( 'click', '.ignore', function() {
alert( 'todo' );
} );
$upload.addClass( 'state-' + state );
updateTotalProgress();
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment